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.

led blinking during boot for debug

Hi

I want to debug my boot-loader by switching on a led  .How can i implement this using assembly language 

I'm using evm6424 .

  • Hi,
    I'm not sure about assembly language.
    You can get sample LED blink test code from spectrum digital inc website (CSL code).

    c6000.spectrumdigital.com/.../reva
  • Hi Titus S.
    thank you Titus . I have a small bootloader to copy the contains from flash to RAM . I want to insert line of code in it to ensure that the boot pass this specific point and move the testing line to ensure that the code executed successfully . simply i want to but a hardware break point during boot to debug the boot loader .

    ;;-----------------------------------------------------------bootloader----------------------------------------------------
    .ref _c_int00
    .ref FLASH_TEXT_START
    .ref RAM_TEXT_START
    .ref TEXT_SIZE
    .ref FLASH_CINIT_START
    .ref RAM_CINIT_START
    .ref CINIT_SIZE
    .ref FLASH_SWITCH_START
    .ref RAM_SWITCH_START
    .ref SWITCH_SIZE


    .sect "bootload"

    ;; Copy the .text section from FLASH_TEXT_START to RAM_TEXT_START
    _boot_start:
    mvkl FLASH_TEXT_START,B4 ; B4 <- FLASH_TEXT_START
    mvkh FLASH_TEXT_START,B4

    mvkl RAM_TEXT_START,A4 ; A4 <- RAM_TEXT_START
    mvkh RAM_TEXT_START,A4
    zero A1

    _boot_loop1:
    ldb *B4++,B5 ; Read Flash
    mvkl TEXT_SIZE,B6 ; B6 <- TEXT_SIZE

    add 1,A1,A1
    || mvkh TEXT_SIZE,B6

    cmplt A1,B6,B0 ; Compare Size
    nop
    stb B5,*A4++ ; Store RAM
    [B0] b _boot_loop1
    nop 5
    ;;;;;;;;;;;;;;;;insert led blink here to check if it reached this section;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;; Copy the .cinit section from FLASH_CINIT_START to RAM_CINIT_START
    mvkl FLASH_CINIT_START,B4 ; B4 <- FLASH_CINIT_START
    mvkh FLASH_CINIT_START,B4

    mvkl RAM_CINIT_START,A4 ; A4 <- RAM_TEXT_START
    mvkh RAM_CINIT_START,A4
    zero A1

    _boot_loop2:
    ldb *B4++,B5 ; Read Flash
    mvkl CINIT_SIZE,B6 ; B6 <- CINIT_SIZE

    add 1,A1,A1
    || mvkh CINIT_SIZE,B6

    cmplt A1,B6,B0 ; Compare Size
    nop
    stb B5,*A4++ ; Store RAM
    [B0] b _boot_loop2
    nop 5
    ;;;;;;;;;;;;;;;;move the led blink here to check if it reached this section;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;; Copy the .switch section from FLASH_SWITCH_START to RAM_SWITCH_START
    mvkl FLASH_SWITCH_START,B4 ; B4 <- FLASH_SWITCH_START
    mvkh FLASH_SWITCH_START,B4

    mvkl RAM_SWITCH_START,A4 ; A4 <- RAM_SWITCH_START
    mvkh RAM_SWITCH_START,A4
    zero A1

    _boot_loop3:
    ldb *B4++,B5 ; Read Flash
    mvkl SWITCH_SIZE,B6 ; B6 <- SWITCH_SIZE

    add 1,A1,A1
    || mvkh SWITCH_SIZE,B6

    cmplt A1,B6,B0 ; Compare Size
    nop
    stb B5,*A4++ ; Store RAM
    [B0] b _boot_loop3
    nop 5
    ;;;;;;;;;;;;;;;;move the led blink here to check if it reached this section;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;; Branch to application start
    mvkl .S2 _c_int00, B0
    mvkh .S2 _c_int00, B0
    B .S2 B0
    nop 5

    ;;------------------------------------------------------END-----------------------------------------------------------
  • Abdalla,

    Which version of CCS are you using? CCSv6 is what I recommend, since it is the latest.

    Which boot mode are you using? Similarly, where does your bootloader reside?

    Are you trying to test whether the hardware boot is happening correctly or whether your own bootloader code is working? I think it is your own bootloader code but need to ask.

    Why not use CCS to debug this? That is why CCS is there, to allow you to test your code with breakpoints and to test things easily.

    Regards,
    RandyP
  • Hi RandyP
    CCS3.3 can i do it with this version
  • Abdalla,

    With the EVM, there is no license fee for using CCSv6. Why would you not upgrade with no cost?

    I have not used CCS4.4 for many years. It will likely work.

    Which boot mode are you using?

    Are you trying to test whether the hardware boot is happening correctly or whether your own bootloader code is working?

    Regards,
    RandyP