AnsweredAssumed Answered

can't realize CAN Bus sleep/wake up function if add CAN bootloader function in code

Question asked by seven ren on Nov 16, 2017

hi there,


now i use S32K144 to develop CAN Bus sleep/ wake up and have make a big progress. i have a problem that need your solve.

now i have realize sleep/ wake up function:

the sleep logic is:MCU  can't receive CAN message within 30s, then MCU excute sleep logic step by step: deinit LPIT/ SPI, enable CAN PN(pretended networking) function, set power mode is STOP2. then MCU will enter STOP2 mode, and current will decrease 15mA.

the wake up logic is : MCU receive CAN message again and meet the logic condition, then enter can0_wake_up_irqn fucntion, then MCU excute wake up logic step by step: set power mode is RUN, init clock, init LPIT/SPI ect.  now MCU can work at RUN mode.


all of above logic can work normal if MCU excute APP code from P-Flash address 0x0000.

if i add CAN bootloader code into my project, and set the APP code from P-Flash address 0x4000. the APP code will show different result. the APP code still can enter STOP2 mode, but MCU can't enter  can0_wake_up_irqn function while sent CAN message to MCU.

do you have any idea?


i can confirm that CAN bootloader code is work well, i have tested CAN bootloader code many times before if i develop sleep/wake up function.

.ld file parameter
1.      APP code will excute begin at 0x0000, if i don't add CAN bootloader into project
  /* Flash */
  m_interrupts          (RX)  : ORIGIN = 0x00000000, LENGTH = 0x00000400
  m_flash_config        (RX)  : ORIGIN = 0x00000400, LENGTH = 0x00000010
m_text                (RX)  : ORIGIN = 0x00000410, LENGTH = 0x0007FBF0

2.       APP code will excute begin at 0x4000, if i add CAN bootloader into project
  /* Flash */
  m_interrupts          (RX)  : ORIGIN = 0x00004000, LENGTH = 0x00000400
  m_flash_config        (RX)  : ORIGIN = 0x00004400, LENGTH = 0x00000010
  m_text                (RX)  : ORIGIN = 0x00004410, LENGTH = 512K-0x00004410