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.

modifying bootloader code and stepping through

Hello,

I am stepping through the bootloader code for the F28335 DSP by loading symbols via the .out file.

I have the controlCARD switches configured to boot to SPI and I have been able to view 0x003 on my o-scope when stepping through and running the code. This corresponds to the read command,  SPI_Transmit(0x003)  in the SPI_Boot() function within the bootloader.

As an experiment, I want to modifiy this read command, i.e. SPI_Transmit (value) so I can see how the signal changes on my o-scope. I want send 0xA3A3 instead of 0x003 for example.

I changed the value in the SPI_boot.c file, and tried to build the code, but I get errors. I saved the changes in the SPI_Boot.c file as well before building but when I stepped through the code, the same read command waveform appeared on my scope, i.e. 0x003 and not 0xA3A3.

What is the correct way to recompile modified bootloader code?

Thank you,

Chuck

  • Chuck,

    we don;t support re-building of the ROM project as it is. It is only provided for reference and study of the ROM code implemented on the device.

    what you can do is create your own RAM based project, implement your own spi_boot.c (you can copy/edit the spiboot.c from the ROM project sources) and call your implemented spi boot function from your main.

    If you want to stick to ROM source debug/stepping, then I suggest you put a break point in the assembly (dis-assembly window) at the right location and hack the CPU register values before the code uses them. Its dirty method but if you want to quickly check you can do that. Creating a RAM/Flash based project by referring to provided ROM sources will help in long run.

     

    Best Regards

    Santsoh

     

  • Santsoh,

    Referring to hacking CPU register values, do you mean watching them in the Register window and changing value there? Similar to changing expression value while stepping through code? Please explain. I am new to Code Composer.

    -Chuck

  • yes...the trick is identify where you should put the break point. You will get better view if you do assembly single stepping in dis-assembly window, but could be over kill if not done properly.

    1.> put a break point at the C function in C source file that you want to RUN and run. Since this is ROM you will have to use HW Break point.

    2.> Once you hit the break point, open/goto disassembly window and do assembly stepping and find out where exactly you want to change the value being used and change that particular CPU register as needed.

     

    depending on what you are doing, you might be able to go by, by simply changing a local variable value in expressions window if not you will have to go modify the needed CPU registers at the right instruction.

     

    Best Regards

    Santosh

     

  • Santosh,

    This is the section of code I am trying to step through. While stepping, it gets skipped and goes directly to the section of code based

    on the value of the _DEBUGSELECT constant that was not defined:

    #define FLASH_BOOT 0xF

    #define SCI_BOOT 0xE

    #define SPI_BOOT 0xD

    #define I2C_BOOT 0xC

    #define CAN_BOOT 0xB

    #define MCBSP_BOOT 0xA

    #define XINTF_16_BOOT 0x9

    #define XINTF_32_BOOT 0x8

    #define OTP_BOOT 0x7

    #define PARALLEL_BOOT 0x6

    #define XINTF_PARALLEL_BOOT 0x5

    #define RAM_BOOT 0x4

    #define LOOP_BOOT 0x3

    #define FLASH_BOOT_NOCAL 0x2

    #define RAM_BOOT_NOCAL 0x1

    #define SCI_BOOT_NOCAL 0x0

    Uint32 SelectBootMode()

    {

    Uint32 EntryAddr;

    #ifdef _DEBUGSELECT

    // To debug without having to select

    // the boot mode via jumpers, define

    // _DEBUGSELECT and comment out the

    // appropriate boot mode to test

    EALLOW;

    SysCtrlRegs.WDCR = 0x0068;

    // Disable watchdog module

    EDIS;

    // EntryAddr = SCI_Boot();

    // EntryAddr = SPI_Boot();

    // EntryAddr = Parallel_Boot();

    // EntryAddr = XINTF_Parallel_Boot();

    EntryAddr = XINTF_Boot(16);

    // EntryAddr = XINTF_Boot(32);

    // EntryAddr = MCBSP_Boot();

    // EntryAddr = I2C_Boot();

    // EntryAddr = CAN_Boot();

    EALLOW;

    SysCtrlRegs.WDCR = 0x0028;

    // Enable watchdog module

    SysCtrlRegs.WDKEY = 0x55;

    // Clear the WD counter

    SysCtrlRegs.WDKEY = 0xAA;

    EDIS;

    #endif

    In the disassembled code, there is no indication of the assembly language equivalent of the #define constants.

    Where do I look for these constants in order to step through the disassembled code (and possibly alter the values to do my experiment) ?