issue:use DTCM cause the peripheral not work(related to MPU) - S32K312

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

issue:use DTCM cause the peripheral not work(related to MPU) - S32K312

570 Views
Ags
Contributor III

hi, developers!

   i use the dtcm as the stack on AutosarOs Task. but i meet the hardfault(Unaligned access UsageFault). i find the SystemInit()  is enable the mpu. but the Privileged Access seems problems. 

  i change the rasr[4] value, from 0x01040021UL to 0x03080021UL(refrence to RTD 4.7.0, SW Version 4.0.0), it's work no hardfault. but peripheral(such as: CAN, UART) is not work. it can't send message.

  i use the RTD AUTOSAR 4.4, SW Version 1.0.0.

  by the way, i add the section(itcm0_code, dtcm0_data) for use the TCM. 

  this problem block me, hoping to get help.

  Attachted the .ld file and MPU code.

Ags_0-1724414272678.png

reference link:

https://community.nxp.com/t5/S32K/S32K3xx-RTD-default-MPU-implementation-causes-problems-seems/m-p/1...

https://community.nxp.com/t5/S32K/S32K312-W-R-FULL-access-MPU-address-leads-to-MemManage-exception/m...

https://community.nxp.com/t5/S32K/How-to-use-DTCM-1-memory-in-S32K314-controllers/m-p/1663024

https://community.nxp.com/t5/S32K/unaligned-memory-access-fault-on-S32K312-with-MCAL-RTD-3-0-0/m-p/1...

https://developer.arm.com/documentation/dui0646/c/Cortex-M7-Peripherals/Optional-Memory-Protection-U...

thanks&regards,

Ags

 

 

0 Kudos
Reply
7 Replies

565 Views
Ags
Contributor III

and, i change the memory .ld file and add the section, as follow;

Ags_0-1724414868626.png

Ags_1-1724414911079.png

Ags_2-1724414941254.png

 

0 Kudos
Reply

499 Views
Ags
Contributor III

  update the issue:
  i use the boot(start Address:0x0040 0000) + app(start Address:0x0050 0000) projiect. In order to test mpu configuration, i change the app start address from 0x0050 0000 to 0x0040 0000. i find the interrupt not work.
  I use the lasted git code and also changed the start address of the application.  the interrupt also not work.
  so maybe boot cause problems? 

0 Kudos
Reply

465 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @Ags 

Does the MPU configuration correspond to your current linker file? It sounds like there's some mismatch.

Regards,

Lukas

0 Kudos
Reply

405 Views
Ags
Contributor III

Hi, @lukaszadrapa 

  Is there any new reply to this question?

thanks&regrads,

zags

0 Kudos
Reply

462 Views
Ags
Contributor III

hi, @lukaszadrapa 

  thanks your response.

  RTD1.0.0 is the file I am currently testing. I modified the MPU configuration in system.c and the linker script file (ld) based on RTD3.0.0. When the origin(int_flash) in the ld file is set to 0x00400000, the peripherals do not seem to work. However, when I change origin(int_flash) to 0x00500000 and program the BOOT, the system works normally. The DTCM also functions correctly.

Ags_0-1724846878361.png

thanks&regards

Ags

 

0 Kudos
Reply

381 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @Ags 
you wrote "the peripherals do not seem to work" - I think it would be worth investigating a bit more to find the root cause. What does not work exactly? Are the peripherals initialized as expected? Does it get stuck somewhere?
Regards,
Lukas

0 Kudos
Reply

373 Views
Ags
Contributor III

 hi, @lukaszadrapa 

  yes,all the peripherals is initialized. none of the source files have changed.

  I only changed the flash start address and length of the link file. the periphaerals(can, uart, lin) is not work.

thanks&regards

zags

0 Kudos
Reply