AnsweredAssumed Answered

ADSP-21489 SPI Flash can not work

Question asked by Guillaume on Jan 7, 2013
Latest reply on Jan 8, 2013 by Guillaume

my custom board use ADSP-21489 and I want to run a simple LED program to test SPI Flash "M25P80".

The program TOGGLE a LED through DPI-07 output.





  interrupts (SIG_TMZ, timer_isr); // enable high priority timer interrupt

  timer_set(2e8, 1e4); // 2Hz timer interrup (abt 2e8/4e8=0.5s=500ms)

  timer_on(); // start timer



        if (core_time_flag == 1)


            core_time_flag = 0;


            ClearSet_LED(LED_TOGGLE & 0x1);

            LED_TOGGLE ++;




void Init_LEDs(void)


    /* setting the SRU and route so that flag pins connect to DPI pin buffers */

    /*connect Flag6 output to DPI_PB07 input (LED) */

    SRU(FLAG6_O,DPI_PB07_I); /* connect Flag6 output to DPI_PB08 input (LED) */

    /*enabling the buffer using the following sequence: high -> output, low ->input */

    SRU(HIGH,DPI_PBEN07_I); /* LED */

    /*setting flag pins as outputs */

    sysreg_bit_set( sysreg_FLAGS, (FLG6O) );

    /*clearing flag pins */

    sysreg_bit_clr( sysreg_FLAGS, (FLG6) );


void ClearSet_LED(const char State)


    /* if State is 0 (LED_OFF) we clear the LED,

    if State is 1 (LED_ON) we set the LED,

    else we toggle the LED */

    if(LED_OFF == State ) { sysreg_bit_clr(sysreg_FLAGS, FLG6); }

    else if( LED_ON == State ) { sysreg_bit_set(sysreg_FLAGS, FLG6); }


void timer_isr (int sig)


     core_time_flag = 1;



I can run the executable file of the above program successfully under debug mode. I generate a loader file (Boot type: SPI flash, format:Hex, Width:8-bit) and modify flash driver based on that of M25P16, which is provided by VDSP++5. I only make two changes for the driver,

  1. //#define NUM_SECTORS 32 /* number of sectors in m25p16 flash device */

     #define NUM_SECTORS 16 /* number of sectors in m25p80 flash device */

  2. repace all the string m25p16 with m25p80


The driver was tested ok using another custom board before.

I can success download the programs to SPI flash. However, when I pull-off the JTAG connector and re-power on the board, the LED
has no blink. Measurement shows that the DPI-07 has a stable 1.55V output,


The board set BOOT_CFG0~2 pins [1 0 0].

Hope to get your help to tell me what's wrong with my SPI flash reboot.