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.

CC251x: Question about flashing by DMA

Other Parts Discussed in Thread: CC2510

Dear Forum,

I have  a question about the CC251X manual section "12.3.2.1 DMA Flash Write" in which figure 22: " DMA Flash Write Executed from within Flash Memory" shows code which triggers the DMA in order to start the flashing.

Important is : "When performing DMA flash write while executing code from within flash memory, the instruction that triggers the first DMA trigger must be aligned on a 2-byte boundary."

Could anybody explain to me what these lines are doing.

-----------------------------------------------------------------------------

; Write flash and generate FLASH DMA trigger
; Code is executed from flash memory
;
#include “ioCC2510.h”
    MODULE     flashDmaTrigger.s51
    RSEG          RCODE (1)
    PUBLIC       halFlashDmaTrigger
    FUNCTION halFlashDmaTrigger, 0203H
    halFlashDmaTrigger:

    ORL            FCTL, #0x02;

    RET;

    END;

---------------------------------------------------------------------

So far I understand is that the RCODE(1) alignes the following code to 2**1=2 byte addresses. This means that the instruction ORL starts word aligned.  The used instruction ORL is a "OR immediate data to direct byte" which takes 3 byte in memory. This means that the instruction starts aligned but needs then 3 byte read from flash which stops reading non aligned.

Is this sufficent to meet the requirement being word aligned?

I wonder also what the parameter "0203H" means, I cannot find any hint neither in the IAR assembler nor in the C manual what this parameter is doing at all.

Thanks for any help in advance.

regards

spachner

 

  • Hi Spachner.

    spachner said:
    Is this sufficent to meet the requirement being word aligned?

    Yes. It's the start of the instruction that needs to be aligned.

    spachner said:
    I wonder also what the parameter "0203H" means, I cannot find any hint neither in the IAR assembler nor in the C manual what this parameter is doing at all.

    Not quite sure. Think this was mentioned in an old IAR documentation and has since been stuck in the code. Google seems to say that this means "Set Processor Exception Handler Vector" whatever that might mean...

    Just for reference. There are some new basic SW examples for the CC2510 to be found here:
    http://focus.ti.com/docs/prod/folders/print/cc2510f32.html#toolssoftware

    Includes code to write Flash both using DMA and CPU.

    Rgds,
    Kjetil