SRAM_OC overflow by adding WS8960 codec api

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

SRAM_OC overflow by adding WS8960 codec api

2,911 Views
claudecdg66
Contributor II

Hello,

I want to add codec support to the host_msd_fatfs_bm for the imxrt 1010 example but when i compile witout changing anything, SRAM_OC overflow by 1.7K. why?

Labels (1)
0 Kudos
20 Replies

2,703 Views
claudecdg66
Contributor II

I found the problem. Its a bug with MCUExpresso 11.1.2.(or his sdk) the errors dosen't appear while i do the same in 11.1.1 it compile fine. I think adding api to an example for some reason default adding the code to oc ram instead of flash. I knew it was weird that adding file into the project could overflow the ram just like that.

0 Kudos

2,703 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi claude-david gaudreault,

  Thanks for your updated information.

   Another point in your MCUXPresso 11.1.2,  please also try set the SDK debug console to UART console instead of Semihost console, any updated result?

pastedImage_1.png

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,703 Views
claudecdg66
Contributor II

i did what you asked and still got the same result

0 Kudos

2,703 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi claude-david gaudreault,   

   Thanks for your updated information.

   Do you check two version project, whether the same optimization level?

   Do you also try the release mode, still have issues?

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,703 Views
claudecdg66
Contributor II

have you tried the same thing on your side? dose it work for you?

0 Kudos

2,703 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi claude-david gaudreault

  You can attach your test project, I am using MCUXPresso V11.1.1, I can help you to check it on my side.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,703 Views
claudecdg66
Contributor II

its all good but an12077 dosent tell me where the memory map for the flex ram is. it dosent tell me the location neither the size to add.

0 Kudos

2,703 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi claude-david gaudreault

 FlexRAM contains: OCARM, ITCM, DTCM, and share 128KB flash.

 So, when you want to change it:

1. modify the memory map size

Change the OCRAM, ITCM, DTCM size in the following picture

memory map.jpg

2.  Modify the flexRAM code in the reset :

Take an example, you need to check the register and modify it for your own size:

FLEXRAM->TCM_CTRL = 4;
IOMUXC_GPR->GPR17 = 0x5AAFFAA5;
IOMUXC_GPR->GPR16 |= 0x7;
IOMUXC_GPR->GPR14 = (9<<20) | (8<<16) ;

3. modify the .scp for your own memory size

You can find the .scp in folder:

C:\nxp\MCUXpressoIDE_11.1.0_3209\ide\binaries\Scripts

an exmaples for your, you still need to modify the related data

100 REM ===============================
110 REM RT1050_connect.scp
120 REM
130 REM Copyright 2019 NXP
140 REM All rights reserved.
150 REM ===============================
160 print "RT1050 Connect Script"
170 REM probelist
180 p% = probefirstfound
190 rem probeopenbyindex p%
200 wireswdconnect p%
210 selectprobecore p% 0
220 cminitapdp this
230 cmhalt this
235 goto 320
240 rem trap in bootrom
250 cmwatchset this 0 0x400F8004 RW
260 cmresetvectorcatchclear this
270 print "Resetting and trapping"
280 cmsysresetreq this
290 print "Back from reset"
300 cmresetvectorcatchset this
310 cmwatchclear this 0
320 print "Disabling MPU"
330 s% = Peek32 this 0xE000ED94
340 s% = s% & 0xFFFFFFFE
350 Poke32 this 0xE000ED94 s%
360 REM ====== Configure FlexRAM ======
370 print "Configure FlexRAM for 128KB OC RAM, 128KB I-TCM, 256KB D-TCM"
380 REM TCM CTRL Poke 0x400B0000 - to force RAM clocking and set wait states = b100
390 Poke32 this 0x400B0000 0x4
400 REM IOMUXC_GPR17 0x400AC044 - this sets bitfield allocation of FlexRAM 32KB banks to OC 256KB b01, I 128KB b11, D 128KB b10
5
410 Poke32 this 0x400AC044 0x5AAFFAA5
420 REM IOMUXC_GPR16 0x400AC040 - this sets enables for I and DTCM and the source of the TCM config = 0x200007
430 Poke32 this 0x400AC040 0x200007
440 print "Finished"
450 REM ===============================
460 end

4.  Modify the stack location from end to start

More details, you also can check this question post:

FlexRAM and Linker Problem 

Wish it helps you!

If you still have questions about it, please kindly let me know.

 

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,703 Views
claudecdg66
Contributor II

Why is this so complicated and what i need to modify i just can't change things and hoping it would work

0 Kudos

2,703 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi claude-david gaudreault,

   If need to modify the flexRAM to the new size, it's really a little complicated.

   or you can define some of your code to the other RAM, eg ITCM or DTCM, otherwise, your OCRAM is overflowed now.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,703 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi claude-david gaudreault 

  From your picture, that your project occupy too much OCRAM, your OCRAM is overflowed.

  Do you put your code in the RAM, not the external flash?

  pastedImage_1.png

pastedImage_2.png

Please check your code, seems your side a lot of code is put in the OCRAM area.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,703 Views
claudecdg66
Contributor II

if checked ram overflow by 73k!

0 Kudos

2,703 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi claude-david gaudreault,

   OCRAM in default is 64KB, your code should already overflow it.

   You may try to define some larger RAM code to the ITCM or DTCM.

   Or you can enlarge the OCRAM size to 128KB, and disable the DTCM and the ITCM.

pastedImage_1.png

   More details about the flexRAM modification, you can refer to the application note:

https://www.nxp.com/docs/en/application-note/AN12077.pdf 

Wish it helps you!

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,703 Views
claudecdg66
Contributor II

will it slow down memory access cause the cpu dosent have acces to TCM memory?

0 Kudos

2,703 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi claude-david gaudreault,

  When you use the OCRAM, you can enable the cache, the cache will help you speed up the memory access.

Wish it helps you!

If you still have questions about it, please kindly let me know.

 

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,703 Views
claudecdg66
Contributor II

How in mcuexpresso can i configure to have the right config?

0 Kudos

2,703 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi claude-david gaudreault,

   Do you want to enlarge the OCRAM size and enable the cache?

   If yes, please refer to the application note:

  https://www.nxp.com/docs/en/application-note/AN12077.pdf

   About the flexRAM modification in the MCUXpresso, after you modify the FlexRAM, you need to modify the memory size, then in the reset code, add the FlexRAM code, the register control fro GPR17, GPR16, GPR14,etc. The .scp for the CMSIS DAP script also need to be modified, you also can refer to this post:

Overview of using the MIMXRT1050-EVK(B) with MCUXpresso IDE 

   It will be useful to you.

   About the Cache, it is enabled in the MPU configuration in the SDK code.

  You also can refer to the cache application note:

https://www.nxp.com/docs/en/application-note/AN12042.pdf 

Wish it helps you!

If you still have questions about it, please kindly let me know.

 

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,703 Views
claudecdg66
Contributor II

memory map.jpg

Here for example is the memory map from the evkmimxrt1010dev_audio_speaker_bm example. We can see that in this example it allow more OCM than TCM but its still not enough to use the fatfs and codec in the same code. How do i arrage this map in order to get enough on chip ram for my project.

0 Kudos

2,703 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi claude-david gaudreault,

  That's why I suggest you disable the DTCM, ITCM, juse use all the flexRAM for OCRAM, about how to conifugre the flexRAM, please refer to this application note which I already share with you:

https://www.nxp.com/docs/en/application-note/AN12077.pdf 

Wish it helps you!

If you still have questions about it, please kindly let me know.

 

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos

2,703 Views
claudecdg66
Contributor II

the link application to ram is uncheck. I don't know why it do that, i jusst added the file for the codec from the sdk and compile without changing any other files

0 Kudos