issue about codewarrior 10.7 and Kinetis startup file

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

issue about codewarrior 10.7 and Kinetis startup file

1,331 次查看
zzkk
Contributor I

hi,I am using codewarrior 10.7 to make a flash driver for kea8.Now I have two issues:

1.I have set up NVIC_ ICER register but it did not turn off all interrupts on the CPU.I want to use the assembly statement 'cpsid i' to close the interrupt, but I can't find this sentence in the file of codearrow10.7.can you tell me how to turn off  or turn on all interrupts on the CPU in this IDE?

2.I want to copy the flash driver from ROM to RAM,I only found the defined sections, but I won't use. Can you tell me how to copy code from Rom to RAM in this IDE?

zzkk_0-1690871624847.png

zzkk_1-1690871646344.pngzzkk_2-1690871700139.png

Thanks for your help.

 

 

 

0 项奖励
回复
3 回复数

1,303 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose that you can use the asm(cpsid i); to disable all maskable interrupt.

For the api function of __copy_rom_sections_to_ram(); pls look for the body of the api function.

Hope it can help you

BR

XiangJun Rong

 

0 项奖励
回复

1,294 次查看
zzkk
Contributor I

hello@xiangjun_rong ,I have used __asm("cpsid i" : : : "memory"),the mcu still could enter to "Default_Handler".And the function "__copy_rom_sections_to_ram()" seems  like there's no body,I cant find it in project files.I'm confused right now.Do you have any ideas or links about this ?

0 项奖励
回复

1,281 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

The HardFault error is an exception with negative priority(the highest priority), the asm(cpsie i)/asm(cpsid i) can only enable/disable interrupt which has zero or positive priority. In other words, the asm(cpsid i) can not disable hardfault exception.

The hardfault error means that your code has error.

First of all, pls check if all interrupt source has corresponding ISR.

xiangjun_rong_1-1690967203886.png

 

BR

XiangJun Rong

 

0 项奖励
回复