Hi all,
I am getting the linker error that my .bss no longer fits in SRAM_DTC.
I can see that SRAM_DTC is 16K large. I understand, this is not small, but I am running FreeRTOS + Lwip + my own application, and my requirements simply exceed the amount of .bss.
What's the best way to deal with this? I thought I could simple delete the SRAM_DTC, SRAM_ITC and SRAM_OC sections when creating a project in MCUXpresse, and push everything in the 30MB external RAM. But when I did that, my board no longer booted up (fixed using troubleshooting section here).
How can I "simply" move the .bss to external RAM?
Many thanks in advance
Best regards, bas
Or is there documentation on this subject that somebody can refer too?
Again, I don't "need" to store .bss on SRAM_DTC. It's "auto generated" that way by MCUXpresso. I don't think I am "allowed" to simply delete the SRAM_DTC section and regenerate stuff, since the RT1020 won't boot when I do this.
I also can't manually change the linker scripts because they are auto generated on build.
So how can I move .bss to external SRAM and still have a booting RT1020?
Many thanks for any pointers!
Hello,
Changing to the external SDRAM instead of using the internal RAM is not hard. First, I would like to point out that there's no need of deleting the internal SRAM regions. You just have to move the BOARD_SDRAM and NCACHE_REGION inside the MCU settings. Your Memory details should look like shown below.
After making these changes, you need to confirm that you have dcd files inside the board folder of your project. These files are the ones that the ROM Bootloader uses to configure the external SDRAM. If you don't have those, you can copy them from any of our SDK example projects.
Then you have to go back to the properties of your project. Inside the settings, you have to go to the Preprocessor option. Once you are there, you'll have to add three symbols.
Finally, you have to move the bss and data sections to the NCACHE_REGION.
That's it! After making these changes, you should not have any problem when using the external SDRAM
Regards,
Victor
Thanks for your reply! I was afraid my NXP experiment was going to die right here :).
It's not working yet. Please check if you can see any mistake I made below.
- I created a new project for my RT1020 in MCUXpresso, left all to default except I selected C++, and moved the BOARD_SRAM and NCACHE to below the flash region exactly as you suggested.
- Generated the project (the dcd files are part of the newly generated project)
- Right click on project
- Select properties -> C/C++ Build -> Settings
- In the Tool settings tab, I select Preprocessor and added the three flags
- Select Managed Linker Script and add the suggested linker script sections
- Select Apply and Close
- Select Yes in the dialog to regenerate / update code.
- Select compile and upload program by selecting debug icon in IDE
As a result the CPU crashes somewhere outside of program scope (0x200....)
(and now my board is no longer detectable, so I guess I will have to flash it again with the full erase option to "revive" it.
What am I missing here? Should I also set the dipswitches differently to get this working?
Thanks!
My board is working again. So at least that's solved.
But I am still unable to move my .bss to board SRAM.
With (afaik) exact steps taken as you suggested I get a hardfault (bus error).
Here a screenshot for what it's worth. Hope that you can support me a bit more until this actually works.
Many thanks in advance!
Hello,
You are using the RT1020-EVK, correct? What version of the SDK are you using? If you make the modifications in an SDK example project, what are the results?
Regards,
Victor