[SOLVED] Code download to MCU error

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

  • [SOLVED] Code download to MCU error

    Hi, i have a LPC1114F/302 based board(footnote 1). I was initially trying to control a GPIO pin, without success. And when i checked the registers, they where all filled with junk, even if i reset the target, the values of the regs stay. Now i am simple trying to put a value into r0: MOV r0, #5 . Though when i download the code nothing happens. My OS is linux mint 17.1 64bit, and im using the fasmarm assembler.
    Here is my procedure:

    $ sudo JLinkExe
    [sudo] password for josef:
    SEGGER J-Link Commander V4.98e ('?' for help)
    Compiled May 5 2015 11:49:39
    DLL version V4.98e, compiled May 5 2015 11:49:35
    Firmware: J-Link V9 compiled Apr 21 2015 18:10:40
    Hardware: V9.30
    S/N: *************
    OEM: SEGGER-EDU
    Feature(s): FlashBP, GDB
    VTarget = 0.000V
    J-Link>power on
    J-Link>si 1
    Selecting SWD as current target interface.
    Setting target interface speed to 1MHz. Use "Speed" to change.
    J-Link>le
    J-Link>device LPC1114/302
    Info: Device "LPC1114/302" selected.
    Reconnecting to target...
    Info: Found SWD-DP with ID 0x0BB11477
    Info: Found Cortex-M0 r0p0, Little endian.
    Info: FPUnit: 4 code (BP) slots and 0 literal slots
    Info: CoreSight components:
    Info: ROMTbl 0 @ E00FF000
    Info: ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB008 SCS
    Info: ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 000BB00A DWT
    Info: ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 000BB00B FPB
    J-Link>loadbin test.bin, 0x00
    Downloading file [test.bin]...O.K.
    J-Link>regs
    PC = FFFFFFFE, CycleCnt = 00000000
    R0 = 00000000, R1 = 60010108, R2 = 00000000, R3 = 00000000
    R4 = 40048000, R5 = 7C5ABECB, R6 = 40048000, R7 = 400483C0
    R8 = C89B2B30, R9 = 3416ABC0, R10= 1CF55939, R11= 5FEA6B36
    R12= 9631F8EE
    SP(R13)= E39FFFE0, MSP= E39FFFE0, PSP= AB11EDC0, R14(LR) = FFFFFFF9
    XPSR = 61000003: APSR = nZCvq, EPSR = 01000000, IPSR = 003 (HardFault)
    CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
    J-Link>r
    Reset delay: 0 ms
    Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
    J-Link>regs
    PC = 1FFF10EA, CycleCnt = 00000000
    R0 = 00000000, R1 = 00000001, R2 = E3A00005, R3 = 00000000
    R4 = 40048000, R5 = 60010108, R6 = 40048000, R7 = 400483C0
    R8 = C89B2B30, R9 = 3416ABC0, R10= 1CF55939, R11= 5FEA6B36
    R12= 9631F8EE
    SP(R13)= 10001FA8, MSP= 10001FA8, PSP= AB11EDC0, R14(LR) = 1FFF1109
    XPSR = 01000000: APSR = nzcvq, EPSR = 01000000, IPSR = 000 (NoException)
    CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
    J-Link>

    (nothing changes after reset)


    Thanks for responses and suggestions!

    1: olimex.com/Products/ARM/NXP/LPC-H1114/

    The post was edited 1 time, last by EI24 ().

  • I fixed the problem! I seems i was using the JLinkExe program wrong. The solution was to first specify SWD, little endian and device(as before). And then halt the processor. Clear the regs manually. Set programcounter to zero. Load program with loadbin. then run the program with 'go'. Now the results are as expected. :)
  • Hi,

    Good to hear that you solved the issue on your own.
    In general, we recommend to pass some "basic commands" on start up of J-Link Commander to it.

    Example:
    JLink.exe -device LPC1114/302 -if SWD -speed 4000
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.