S32K144

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

S32K144

3,848 Views
zq1
Contributor III

there are two problems,i hope someone could give me some advices;

first,when i debug the S32k144 ,the program will enter defaultisr:

like below:

zq1_0-1690355707236.png

how can i Analyze the cause??

them ,when i used the sdk of flash driver  ,i want to erase two sector ,the first time of erase is ok,but the second time will jump to DefaultISR in the sdk function  ret = FLASH_DRV_CommandSequence(pSSDConfig);

the pSSDConfig is same with first time 

 

 

hope your reply ,thank you 

 

0 Kudos
Reply
7 Replies

3,804 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @zq1,

The DefaultISR is probably the HardFault handler.

Create this function in main.c

void HardFault_Handler(){
while(1){}
}

You can debug it as shown in this document:

https://community.nxp.com/t5/S32K-Knowledge-Base/Fault-handling-on-S32K14x/ta-p/1114447

 

What is in this region: 0x00011000, 0x00011FFF?

 

Double check that the FLASH_DRV_CommandSequence() function is in SRAM.

The MCU does not allow reading the flash block while there is a flash operation on that block.

 

Thank you,

Regards,

Daniel

 

 

 

0 Kudos
Reply

3,790 Views
zq1
Contributor III

thank you ,i will read the articel you gave me ,this problem has been solved, but i have another question, i relocate S32_SCB->VTOR, what i have done like below:

int main(void)
{
/* Write your code here */
S32_SCB->VTOR = 0x00012100 ;
__asm volatile ("cpsie i" : : : "memory");
CPU0_Process();

 

in the link file :

 

MEMORY
{
/* Flash */
m_interrupts (RX) : ORIGIN = 0x00012100, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00012500, LENGTH = 0x00000010
m_APP_COMPATIBLE_INFO (RX) : ORIGIN = 0x000012000, LENGTH = 0x00000020
m_text (RX) : ORIGIN = 0x000012510, LENGTH = 0x00032000

this project is app project from my boot project,i just change the interrupt table,like that,my boot project  runs well,and enter lpit irq hander nomal,but my app project can't enter  lpit irq hander nomal,i guessed the project can't find  lpit irq hander number,but how to prove it?

hope your reply

 

 

 

 

0 Kudos
Reply

3,776 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @zq1,

Is the LPIT flag set in the application?

Is the interrupt pending in NVIC? If so, read the PRIMASK.

Or does it go to the DefaultISR() or does it run away?

Can you check the vector table at 0x00012100, find the LPIT vector and check the pointer to the LPIT_ISR function?

 

Regards,

Daniel

0 Kudos
Reply

3,728 Views
zq1
Contributor III

yes,it enter DefaultISR:

0x12658 <WDOG_EWM_IRQHandler>

zq1_0-1690769283337.png

and i also want to know The smallest unit of address byte alignment of m_interrupts??

0 Kudos
Reply

3,714 Views
zq1
Contributor III

before relocate interrupt tables,the project runs well,and the lpit interrupt runs well,after relocate the interrupt table ,once enable the lpit interrupt,the projrct will into defaultisr when the counter overflow:

zq1_0-1690792006121.png

 

Tags (1)
0 Kudos
Reply

3,670 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @zq1,

Please double check the VTOR register, then, the LPIT vector in vector table of the application, and the ISR at the address in the LPIT table.

 

Thanks,

BR, Daniel

 

 

0 Kudos
Reply

3,836 Views
zq1
Contributor III

this is my link file:

zq1_0-1690370319615.png

when i define a const global var named Flash_pFlashTable, i debug ,found the Flash_pFlashTable initial value stored in 0x00010000-0x00010FFF; so when i erase the first sector 0x00010000-0x00010FFF, it erased ok ,it means the first rease clear my Flash_pFlashTable intial value,so i second  to rease {0x00011000,0x00011FFF} throuth Flash_pFlashTable,it will enter DefaultISR  like above, so i want to know how the global variable initial will be placed in flash ,why i can erase them ???

const  Flash_flashSector Flash_pFlashTable[FLASH_PFLASH_NUM_SECTORS] = {
// {0x00010000,0x00010FFF},
// {0x00011000,0x00011FFF},
{0x00012000,0x00012FFF},
{0x00013000,0x00013FFF},
0 Kudos
Reply