RT1020 EVK board: section `.bss' will not fit in region `SRAM_DTC'

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RT1020 EVK board: section `.bss' will not fit in region `SRAM_DTC'

2,415 Views
bp1979
Senior Contributor I

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

 

0 Kudos
Reply
5 Replies

2,404 Views
bp1979
Senior Contributor I

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!

0 Kudos
Reply

2,390 Views
victorjimenez
NXP TechSupport
NXP TechSupport

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. 

victorjimenez_0-1626912314099.png

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. 

victorjimenez_1-1626912454497.png

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. 

victorjimenez_2-1626912553645.png

Finally, you have to move the bss and data sections to the NCACHE_REGION. 

victorjimenez_3-1626912608890.png

That's it! After making these changes, you should not have any problem when using the external SDRAM

Regards,
Victor 

0 Kudos
Reply

2,385 Views
bp1979
Senior Contributor I

Hi @victorjimenez 

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

bp1979_0-1626942278999.png

 

- Select Managed Linker Script and add the suggested linker script sections

bp1979_1-1626942379307.png

 

- 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!

 

 

 

 

0 Kudos
Reply

2,369 Views
bp1979
Senior Contributor I

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!

 

bp1979_0-1626983668708.png

 

0 Kudos
Reply

2,334 Views
victorjimenez
NXP TechSupport
NXP TechSupport

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 

0 Kudos
Reply