Program in flash not running if I'm not debugging - SAM3S

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Program in flash not running if I'm not debugging - SAM3S

    Hi, I'm an argentinean engineering student, and I'm developing a project using the AT91 SAM3S4C MCU. I'm also using Codesourcery, Eclipse (Juno version), and Segger J-Link Debugger.

    The problem is that after I compiled my project, and download it to the internal flash memory, I can run the program only if I'm debbugin it. If I disconect the JLINK and reset the MCU, it doeen`t start running the code, eventhough I check that the program is written in flash (at address 0x400000 in this case).

    Heres there are the initialization commands that I use:

    target remote:2331
    mon interface JTAG
    monitor flash device = AT91SAM3S4C
    monitor flash download = 1
    mon clrbp
    monitor endian little
    mon speed 100
    mon reset
    mon sleep 100
    mon sleep auto
    monitor writeu32 0xE000ED08 = 0x00400000


    After launching the J-Link GDB Server and the debug on Eclipse, here is what the GDB server log outputs:

    SEGGER J-Link GDB Server V4.68a

    JLinkARM.dll V4.68a (DLL compiled Apr 12 2013 13:26:50)

    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link ARM V6 compiled Jun 20 2012 19:43:26
    Hardware: V6.00
    S/N: 56001368
    Checking target voltage...
    Listening on TCP/IP port 2331
    Connecting to target...
    J-Link found 1 JTAG device, Total IRLen = 4
    JTAG ID: 0x4BA00477 (Cortex-M3)
    Connected to target
    Waiting for GDB connection...Connected to 127.0.0.1
    Reading all registers
    Read 4 bytes @ address 0x00000000 (Data = 0x20002B5C)
    Target endianess set to "little endian"
    Selecting device: AT91SAM3S4C
    JTAG speed set to 100 kHz
    Resetting target
    Downloading 16160 bytes @ address 0x00400000
    Downloading 10504 bytes @ address 0x00403F20
    Downloading 8 bytes @ address 0x00406828
    Downloading 1416 bytes @ address 0x00406830
    WARNING: CPU is running at low speed (3278 kHz).
    Writing register (PC = 0x004048a4)
    Read 4 bytes @ address 0x004048A4 (Data = 0xB082B580)
    Read 2 bytes @ address 0x004006AE (Data = 0xF04F)
    Read 2 bytes @ address 0x004006AE (Data = 0xF04F)
    Read 2 bytes @ address 0x004006AE (Data = 0xF04F)
    Read 2 bytes @ address 0x004006AE (Data = 0xF04F)
    Read 2 bytes @ address 0x004006AE (Data = 0xF04F)
    Read 2 bytes @ address 0x004006AE (Data = 0xF04F)
    Reading 72 bytes @ address 0x00000000
    Reading 72 bytes @ address 0x00000000
    Reading 64 bytes @ address 0xFFFFFFC0
    WARNING: Failed to read memory @ address 0xFFFFFFC0
    Reading 64 bytes @ address 0xFFFFFFC0
    WARNING: Failed to read memory @ address 0xFFFFFFC0
    Reading 64 bytes @ address 0xFFFFFFC0
    WARNING: Failed to read memory @ address 0xFFFFFFC0
    Reading 64 bytes @ address 0xFFFFFFC0
    WARNING: Failed to read memory @ address 0xFFFFFFC0



    Meanwhile, on Eclipse log, it appears the following message:

    No source available for "0x0"

    and the debugging is suspended. I can resume it, and go on debugging normally. But the poblem is that when I disconect the J-Link, the program does not continue running. I think that it is because of a configuration mistake, but I can`t solve it.

    Best regards,
    Matias