Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

Error in running program using flash

$
0
0

Hi all,

I encountered a problem which is unreasonable for me, and I hope anybody probably know this can give me a hint. In short, using flash .cmd file causes the interrupt I set failed to be triggered(which woks fine if using RAM .cmd). Below is the details:

I am using 28033 as my processor. And the main source file contains three parts: CPU timer interrupt ISR, SPIFIFO interrupt ISR, and infinite for loop in main function. CPU timer interrupt will be triggered at certain time interval, and this CPU timer interrupt is used to start data transmission using SPI. Then CPU timer interrupt ends and wait for the SPIFIFO interrupt. After a while when SPI data transmission complete(I set the depth of SPIFIRO RX to be 1), SPIFIFO interrupt will be triggered and do some calculation. SPIFIFO interrupt will always ends on time to get CPU ready to receive next CPU timer interrupt. In my previous program, the .cmd file is RAM type, and it works fine. After I change my .cmd file to flash which comes from ControlSuite flash .cmd file example without any modification, I made some change in my program. That is to declare:

#pragma CODE_SECTION(InitFlash, "ramfuncs");------before my main function

memcpy((Uint16 *)&RamfuncsRunStart,(Uint16 *)&RamfuncsLoadStart, (unsigned long)&RamfuncsLoadSize);
InitFlash();----------------Copy InitFlash function to ram and run it

No error is shown while building this project, and the result when debugging this program was that CPU timer interrupt and SPIFIFO interrupt was successfully triggered once. After the SPIFIFO interrupt was finished, the next CPU timer was interrupt never triggered again. And of course same for the SPIFIFO interrupt afterwards.

Since I didn't make any other modification to my program but the two mentioned above, is there any reason which causes my CPU timer interrupt and SPIFIFO interrupt just triggered once?

Any help is appreciated!

Hezi


Viewing all articles
Browse latest Browse all 262198

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>