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.

Programs runs with USB100v2 (JTAG) but no with SD card

Hi,

I have been able to run and debug many examples (led blinking, uart0..) and my own programs with JTAG (using Blackhawk USB100v2) and to run examples with the sd card perfectly. But, when saving my own programs in the sd card (building them in release mode) they don´t run.

I supposed that it´ was because some project properties, but I have checked them and I have the same in the examples projects than in my own ones.

Any suggestion?

REgards,

  • In the same project:

    Uart1_sdcard (copied from "AM335X_StarterWare_02_00_00_07\build\armv7a\cgt_ccs\am335x\beaglebone\gpio")

    I have released first with the linked .c file AM335X_StarterWare_02_00_00_07\examples\beaglebone\gpio\gpioLEDBlink and it runs OK in the sd card,

    and later I have tried removing that.c file and linking uart1.c (my own program) and it doesn´t work with the sd card, but I change to DEbug mode and it works with the the JTAG and Blackhawk USB100v2 emulator...

    Has it got sense?

  • Have you tried to build a DEBUG-version and deploy it on your SD-card?

    If this version works: some of your release optimisation settings damage your code, so you have to change them to same settings like in debug-version then modify them step by step to find out at which point they got damaged. This is also true for the libraries you are linking with, some of them definitely do not work with the predefined release-settings.

    If this does not work: hm, don't know :-o

  • Hola Xavier,

    I followed the flashing and booting guide and I've encountered some problems as well. First check that your board is booting from uSD card, one way to check this is with an UART Console, as the bootloader writes stuff during initialization on UART0.

    Make sure your cmd file (the linker file) in your project is the appropiate one, copy the one on the Starterware example directory if needed or make your own based on this one, you might need to add some libraries to your project from the libs directory after changing this file or else it won't compile. Second, change on project settings for your configuration (Release/Debug) the linker initialization from ROM to RAM. And third follow the flashing and booting guide on the wiki to generate the app file.

    You might need to add these lines on your main too:

    	extern unsigned int iram_start;
    	extern unsigned int iram_size;
    	extern unsigned int relocstart;
    	extern unsigned int relocend;
        memcpy((void *)(&relocstart), (const void *)(&iram_start), (unsigned int)(&iram_size));

    I didn't go into details why these works as at the moment I don't exactly know why, but this worked on a BeagleBone Black after a bit of testing.

  • Hello again,

    At the end I manage to make it work.

    After hours and hours trying numerous setting and code changes, I realised that although the program sent the correct information through the UART1, it didn´t work properly because it was stopped at a reset:

    GPIOModuleReset(GPIO_INSTANCE_ADDRESS);

    I inserted that code because I want to see the led blinking every time it transmitted something. I downloaded another code for the gpio example (led blinking) from github.com and finally it worked OK. It could be because joining 2 programs (gpio+uart0)of that version of starterware (AM335X_StarterWare_02_00_00_07) in the same program crashed...

    Anyway thank you for your help. :)

    Regards,