This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

flash programming pointer

I am having some problems with flashing operating tables over CAN.  I can erase a sector.  I can run all of the flash tools and reprogram data with a simple test setup in main().  I setup a buffer in my code to look at the data I get from CAN and its correct.  But the flash is never programmed correctly.  I've attached the code.

I'm trying to set up a diagnostic buffer of Flash_ptr and FlashBuffer.  That way I can see if it's trying to program the correct address and with what data.  I can't get the code to put the pointer address value into my diagnostic buffer. 

if Flash_ptr = (Uint16 *)(&Imot[row][column], why doesn't

dbData[dbIDX][0] = Flash_ptr  put the address into the array?

Thanks!6153.CANB.doc

  • Carl,

    Looks like you're on the right track, but you're trying to program flash in an ISR which is not allowed. In fact there really is entirely too much code in this ISR.  Really the CAN ISR should only be responsible for grabbing data from the message and storing it in a CPU accessible buffer and possibly setting a flag some where.  You're main application should then check this flag and when it is asserted deal with any data received.

    Short answer: Take the call to Flash_Program out of the ISR and it should work.

    Regards,

    Trey