- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
From below discussion, it seems that user app occupy the upper 26k(or 30k) byte of the IRAM.
BCM20732 Memory Map Architecture
But from the build log of hello_sensor app in wiced 2.1.1, the patch+app space was not in the area mentioned above.
The RAM space from 0x204568 to 0x204568+6005 reside in the "DATA ONLY" area which should be only for the stack.
Patches start at 0x00204568 (RAM address)
Patches end at 0x002052D0 (RAM address)
Application starts at 0x00204F70 (RAM address)
Application ends at 0x00205CDD (RAM address)
Patch size (including reused RAM) 3432 bytes
Patch size 2568 bytes
Application size 3437 bytes
------
Total RAM footprint 6005 bytes (5.9kiB)
Can anyone correct my understanding?
thanks.
Roger
Solved! Go to Solution.
- Labels:
-
SDK 2.X
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't know the answers to your detail memory architectural questions, but you should know that this level of understanding is not normally required as the mini-driver which resides in firmware will load your application into the available RAM when you program the part. Available RAM for your application is generally right around 27-28K on A1 silicon.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't know the answers to your detail memory architectural questions, but you should know that this level of understanding is not normally required as the mini-driver which resides in firmware will load your application into the available RAM when you program the part. Available RAM for your application is generally right around 27-28K on A1 silicon.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks for your reply.
Can i say that only the memory space from 0x00204F70 to 0x00204F70+28K is for user app and the other space is reserved for LE STACK (configuration, buffer, heap, etc) in A1 silicon?
thanks a lot.
Roger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
26K is probably a safer number to use. Exactly address where the application starts and stops can be tricky as there are alot of things happening dynamically within RAM as described here (uses Hello_Sensor as the example): BCM20732 Memory Map Architecture
Scroll down to this point where the explanation becomes much more detailed:
As you can see, there is overlap between Patches and Beginning of Application
So after the Patches are finished loaded, a portion of the RAM is available for the Application
Here is what is happening:
- Patches start at where the ROM finished 0x00204568
- Patches end at 0x00204AFC, but the Application starts at 0x00204974 even before the Patches end
- So there is an overlap.
- Once the application ends at 0x00204C28, but dynamic allocation starts even before this.
- The reason is that in the order in which we boot, The Patches get copied in first and they will get initialized.
- Then the section of the code where there in Patch initialization, that will get reused and we will put the application on top of it and overlay the application.
- Once the Patch Init code is running, we can replace that section with the application code.
- We are re-using the RAM from the Boot Loader and Reusing the application initialization code also for dynamic allocation
- Once we have initialized, we don/t need that code anymore.
- The ROM boots and copies in ALL of the patches
- And then it will run the Patch Init Code and installs all of the MANDATORY patches
- Once that copy is done, you don’t need that Patch Init Code
- The ROM will copy the Application on top of it.
- Overwrite the Patch Init Code with Application Code
- Application Code will be 1.7K of code or less.
- The App calls the App Init Function and will say, available RAM is here
- Then the ROM starts Dynamic Allocation from here
- What goes in?
- Buffer,xx, Stack Buffer Tools, and Data
- Call Back Registrations
- Dump the Stack on the Peripheral UART and reset
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks a lot ^_^