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.

5416 very strange problem (difference with and without the emulator)

 I've just realized that i can't make a simple delaying loop work while running without the emulator. Normally, following code would call to SayHello() func after reaching the loop. But this never occurs. ( SayHello() func send some data through UART to computer RS232 interface, so i can observe it.) However this happens, as expected, while working with the emulator. 

long i = 0;
while (i < 99999) i++;   
SayHello();

 

 

  • Ok, I have partially solved the problem. It was the stack. After stack initialization, I make it work.

  • Thanks for sharing the solution.

    Is this problem now resolved?

    Regards,
    Mark

  • Yes, it is now totally working. Actullay, two problems existed. 

    1. While I was working with emulator, stack pointer never crosses the inaccessible memory areas although I reserve space for the stack but forget initializing the SP. So, all my code was working successfully. However, without emulator even a simple delaying loop wasn't working since SP was wrapped around inaccessible areas. After initializing the SP to beginning of reserved stack area, it worked.

    2. I haven't stated my second problem here but it's better to mention it. I was also using CCS and emulator in order to program flash memory for bootloading operation. (Not the own programmer device or any serial interface of the flash mem) For this purpose, I build my own boot table which includes hex codes of my running program. (By using hex500 tool and a C-program developed in Visual Studio.) After introducing the flash memory as an external memory device to the DSP, with a second CCS program I write this boot table to flash mem. In theory, everything would worked. However, I was always getting wrong output data from the McBSP output o my DSP while working with bootloader. This is because I used some floating numbers in some 'if' conditions. Although the program memory was loaded with same data everywhere while working with and without the emulator, it wasn't working without the emulator. After changing those floating numbers with integers (ex: I was using 'ratio<0,4' , instead I defined and used 'count<275' ) and created the boot-table again, it worked. Now I have a device which is totally working seperately. It's so interesting. 

    I don't know what lies behind these issues. I'm sure that some logical explanation exist. Most probably, I made a small mistake while preparing my own-boot table and programming it to the flash using CCS again by myself. I do not know much about DSPs. 

    Thanks for being interested. 

  • Kaan Cetinkaya said:
    I do not know much about DSPs

    It sounds like you are doing pretty well!

    Let us know if there are any issues you cannot tackle.

    Thanks for sharing your solution.

    Regards,
    Mark

  • Excuse me!
    Can you write exaple code on C how you to set up SP.