Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
13July2016
AnIncubator Project intheApacheSoftwareFoundation
http://mynewt.apache.org/
OpenSourceOSforConstrainedIoT– MCU/Hardwareindependent– ARMCortex-M*,AVR,MIPS,more...
• RISC-V
http://mynewt.apache.org/
ApacheMynewt
FirstreleaseofasuccessfulIoT product…
…nowmakethatrepeatable,please.
ProblemandContext
Runtime: ConfidentialandProprietary(2016)
IoTisbeingdrivenbytheSystemonChip(SoC)ApacheMynewtaddresseseverythingneededforSoC development
MemoryFlash
Peripheral Security Radio
Compute
Characteristics
• CPU:48MHz-300MHz, Cortex-M• Radios:BLE,Wi-Fi,802.15.4(g)• Flash/RAM:512KB/64KB(today),
1MB/256KB(thisyear)• Size:3-12mm
Benefits
• Inexpensive• LowPower• Easytomanufacture
Power Time Sensing
ApacheMynewtis“Linux”fordevicesthatcannotrunLinux
Runtime: ConfidentialandProprietary(2016)
RuntimewithMynewtModernizesDevelopmentforSoCs
WithoutRuntime
BuyRTOS
BuyNetStack
BuildBootloader
WriteFlashDrivers
DevelopLogging
SupportChip
ChooseCompiler
WithRuntime
ConnecttoRuntimeManagementService
ProvisionAWSenvironment
DevelopApplication
UseApacheMynewt
MFRGSupport
WriteGateway
DevelopSWUpdate
Development:Faster,Consistent,Repeatable.EscapeHWlock-in.
OSGatewayCloud
• Discovery• Registration• Provisioning• Stats&Logging• ConfigurationManagement• CoreManagement• ImageUpgrade
AnotherView:InitialBluetoothLowEnergySystem
NewtMgrDeviceProvisioning
SoftwareUpgrade
FailureAnalysis
Runtime: ConfidentialandProprietary(2016)
Onlyend-to-endplatformbuiltatopFOSS;usage-basedcloud
IPProviders
MCUVendors
Cloud Providers
End-Users
• LiberalApache2.0license• Individuals,notCorporations• Meritocracy• Strong licensingandIPpolicies• Longhistoryofworkingwithlarge
organizations:IBM,Oracle,Pivotal/EMC
• Manyyearsexperiencemanaginglarge,complexprojects:ApacheWebServer,Hadoop,Cassandra,Kafka,Subversion, etc.
WhytheASF?
ACommunityEffort
Community-driven OpenSource:BestWaytoMaintainHealthyUserEcosystem
(today)• Bluetoothconnectedproducts
• Medical:everything• Consumer/Enterprise: locks,lights• Industrial
• Makers• Home• HardwareLabs• Clothing
(tomorrow)• BluetoothLowEnergy4.2à Bluetooth5• IndustrialWirelessSensorNetworks• Wi-FiProducts• WhoKnows?
• PowerOptimization
• Meshnetworking
• Security
• SensorAlgorithms
• ControlSystems
ScaleMakesProblems Interesting
ApacheMynewtUsers
#commits
• 280,000linesofcode(March2016)
• InitialsupportforSimulator,NordicNRF51/52,STM32F3/4andArduino• Announced:ArduinoPrimo,ArduinoOtto
• Activecontributors,WeWantYou!ü http://mynewt.apache.org/
ProjectStatistics
Makeiteasytofind, install3rd partylibraries
Maintainandre-usepackagesacrossmultiple
products
Managedebugandproduction build setups
Goals
Efficiency:useonlywhatyouneed
• Everythingisapackage.Eachpackagedescribes itsdependencies totherestoftheworld
• Acollection ofpackagesiscalledanapplication
• Thereareafewspecialpackages:BSPandProject.Projectcontainsmain() andBSPdefines linkerscriptandhardwarelayout
• TargetsareusedtocombineprojectsandBSP
• Packagescanbedistributed, upgradedandinstalledremotely
Description
BuildandPackageManagement
Composeacrossmultiple repos
apache-mynewt-coreOSHALBSP
ProjectStructure(comingsoon)“core”brokenintoappropriatesub-projects
apache-mynewt-ble apache-mynewt-nffs apache-mynewt-sys
ASFInfrastructure: Governance,Licensing Rigor
github-sensor-apigithub-bsp1
github-bsp2
github-hal-implgithub-app1
github-network-impl
Github
• ASFgovernancestructure(PMCs)correspondswithsub-packagestructure• ASFrepositoriesclean,Apache2.0license• Userscanassembleprojectssourcedfrommultiplerepos
Composabilityacrossmultiple reposprovides flexibility
3rd PartyRepo(s)
github-app2
ProvidequalitydriversformajorMCUplatforms
Designforcross-platform:well-definedAPIsforHAL,BSPand
drivers
Goals
Makeiteasytoaddboardspecificdefinitions
• BSPdefinition isprovidedin<app>/hw/bsp
• HALdefinitions areinhw/hal andcontainuniform, cross-platformAPIs
• MCUdefinitions areinhw/mcu andprovideimplementations forvariousMCUs• Hierarchyallowscode-reusewithin
MCUfamilies
• BSPsforcommondev kitsareavailableaspackages(e.g.,NordicnRF51/2DK)
• BSPsdependonMCUs
• BSP+MCUprovides implementation forHALAPIs
Description
BSPandHAL
ChipVendors:WeWantYou!
• Pre-emptive,multi-taskingRTOS• Strict,priority-basedscheduling• Upto253differentpriority levels
• Ticklesskernel
• Powermanagement
• Resourceutilization tracking
• Built-intasks:• Idle• Sanity
Kernel
• EventQueuesprovideamechanismfor“mostlysleeping”asynchronoustasks
• Wake-upon:• Messagefromanothertask• Timer• I/Ostatechange• Incomingpacket• Watchdog
• Performoperations:• Sendanalert• Respondtoarequest• Scheduleawakeup
• Gobacktosleep
EnergyEfficientEventModel
Bootloader BootVars
Image2
Image 1
NFFS(User)
CB(User)
• BootloadercanbelocatedinROMorFlash• Options forinternalandexternalflashes
• Performs integritycheck andswapsimages• ImagescontainSHA-256hashandRSAsignature• NFFSoptional
• Providesalog-structured flashfilesystem designed forsmallflashes• CB(CircularBuffer)optional
• Provides implementationofflashcircularbuffer
EnergyEfficientEventModel
WhatWe’reProtecting HowWeProtectIt
Bootloader • Firststagebootloader canoperatefromROMandverifysignature of secondstagebootloader
Images • AllimageshaveSHA-256 ofimagecontents• Images support signing withECCorRSA2048bit
signatures• Secondstagebootloader canverify imagesignature
Network Interfaces • Fullsupport for BLE4.2securityat1.0release,including link-layerandapp-layer
SystemSecurity
• Inaddition tovariousMCUports:OS,HAL,FSandthemajorityofpackagescanrunonMac,Linux
• Developyourcodeonthehostandthenport totherealhardware
• Unittestframeworkisincorporatedtoallof thepackages:abilitytorununittestsonsimulatedenvironmentandrealhardware
• OSandlibrariesarefullyregressiontestedtoensureAPIcompatibilitybetweenreleases
SimulatorandTestFramework
V0.8
April2016
V0.9
May2016
V0.10
June2016
V0.11
July2016
V1.0-b1
Aug2016
V1.0-GA
Oct2016
Highlights
v0.8: Firstrelease,BLE4.2,FFS,Kernel,Console,Shell,SecureBootv0.9: ExpandedHWsupportandHALv0.10: Wi-Fi&IPsupportv0.11: FullBluetoothSupport /Qualificationv1.0(GA) APIcompatibility,FullRegressionTesting
ApacheMynewtRoadmap
Mynewt Components/Composition MinRAM
MinROM/On-chipFlash
CoreOS kernel <1kB <6kB
Blinky application (incl.GPIO,HAL,console, shell) 17kB 23kB
Bootloader (incl.Newtron FlashFileSystem) 4.5kB 25kB
NimBLE stack(incl. bothperipheralandcentralroles,legacypairing) 4.5kB 69kB
BLE exampleapplication“bleprph” (incl.OS,radio,NimBLE) 15kB 99kB
RecommendedRAM/Flash32-64kB/256-512kB
Runtime: ConfidentialandProprietary(2016)
ImageSize
BLEComponent BLEConfiguration Element Default(kB)
ElementSize(kB)
DefaultSize(kB)
Sizeforx# ofconnections
Host(.bss+.data) 3828
Host(runtimeRAMreqs)
HCIbuffer 3 64 204 Independent
Max #ofconcurrent connections 1 80 80 x*80
Max #ofservices 5 8 40 Independent
Max #ofconfig descriptors (peripheral) 1 4 4 (x+1)*3
Max#ofconcurrent GATTprocedures 2 40 80 Independent
Max.# oftotalATTattributes 36 32 1152 Independent
max_prep_entries (forpartial writes) 6 12 72 Independent
Max#ofL2CAPchannels (3 perconnection) 3 28 84 x*3
Max#concurrent L2CAPsignalling procedures 2 20 40 Independent
Max #concurrent SecurityManagerprocedures 1 360 360 Independent
Controller(BSS+data)
Max #ofconcurrent connections 1 416 416 x*416
#ofduplicatescanadvertisers 8 8 64 Independent
#ofscanresponseadvertisers 8 8 64 Independent
Whitelistsize 8 8 64 Independent
Resolvableprivateaddress list 4 40 160 Independent
RNG buffersize 32 1 32 Independent
RuntimeRAMrequirementforNimBLE withdefaults(includingsecurity):6744kBRuntime: ConfidentialandProprietary(2016)
RAMRequirementsforBLEApplications
DynamicPowerManager+Tickless OS
(Goal:toachievethemostpower-efficient
state)
MCUpowerstates,peripheralpower
consumption, constraintsonstatetransitions
(e.g.,“ChipCsupports 3sleepstateseachwithtransitiondelayTd
andenergyoverheadEo)
Timeout-basedsystempowerpolicies
(e.g.,“enactdeepestsleepstatewheneverpossible for
applicationA”)
Enable/DisableMCUperipherals
(e.g.,disableclockandpowerdomains forserialportsince
constraintshavebeenreleased”)
Runtime: ConfidentialandProprietary(2016)
PowerManagement