Question about 2073x memory map

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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

1 Solution
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

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.

View solution in original post

0 Likes
4 Replies
MichaelF_56
Moderator
Moderator
Moderator
250 sign-ins 25 comments on blog 10 comments on blog

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.

0 Likes
Anonymous
Not applicable

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

0 Likes

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:

  1. Patches start at where the ROM finished 0x00204568
  2. Patches end at 0x00204AFC, but the Application starts at 0x00204974 even before the Patches end
  3. So there is an overlap.
  4. Once the application ends at 0x00204C28, but dynamic allocation starts even before this.
  5. The reason is that in the order in which we boot, The Patches get copied in first and they will get initialized.
  6. 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.
  7. Once the Patch Init code is running, we can replace that section with the application code.
  8. We are re-using the RAM from the Boot Loader and Reusing the application initialization code also for dynamic allocation
  9. Once we have initialized, we don/t need that code anymore.
  10. The ROM boots and copies in ALL of the patches
  11. And then it will run the Patch Init Code and installs all of the MANDATORY patches
  12. Once that copy is done, you don’t need that Patch Init Code
  13. The ROM will copy the Application on top of it.
  14. Overwrite the Patch Init Code with Application Code
  15. Application Code will be 1.7K of code or less.
  16. The App calls the App Init Function and will say, available RAM is here
  17. Then the ROM starts Dynamic Allocation from here
  18. What goes in?
  19. Buffer,xx, Stack Buffer Tools, and Data
  20. Call Back Registrations
  21. Dump the Stack on the Peripheral UART and reset
Anonymous
Not applicable

thanks a lot ^_^

0 Likes