Posts by wella-tabor

    Hello,

    I would like to verify my thoughts about the Unlimited Flash Breakpoints functionality and Cortex-m3. As far as I know the UFB replaces the instructions in code memory by a some kind of BPKT instruction in case all hw breakpoints are consumed. The replaced instruction is then somehow "emulated", e.g. mov r1, r0 the jlink moves content of r0 to r1 using the debug read/write register sequence.

    Here comes the problem. If the internal flash of MCU is modified and the jlink is disconnected during debug session from its usb cable the BPKT instruction will remain in flash. Next time (e.g. after reset), now running without the jlink - the firmware is already inside, the BPKT is executed with C_DEBUGEN = 0 what should escalate to HardFault [Yiu J., The Definitive Guide ..... Figure: Debug events for halt mode debugging.]

    Am I right?


    BR
    Martin

    P.S.
    Please do not reply with: You should never unplug the cable during debug session. I know it and I am not doing it.

    If you can explain for what you need it, I can bring it up for discussion.

    Thank You Alex.

    Why I had such question: I am programming a custom flash update function, the firmware is loaded into the MCU's internal flash (currently the LPC1788) and is taken from external SPI or Nor Flash. I have tried to write a simple app to test a communicatation with the SPI, Nor Flash and the IAP (NXP LPC In-Application Programming) functionality. The test app performed MCU reset after successful fw download. With the debugger I have put a breakpoint in main and the reset procedure to stop downloading again and again. After finishing my working hours I let the computer switched on because I work from home via VPN sometimes. Because I have closed all applications and the target was released from debug state (with reset) and performed flash update again and again over all night .... That's my fault I know, I do not argue.

    I can imagine plenty of use cases where this feature (enabled by default) would bother others. Anyway, maybe the following behaviour is only with our board design, but when I disconnect the usb cable from the J-Link, the target is kept in reset.

    BR
    Martin

    Hi,
    thank You for answer I was not aware of the r[0|1] command. Executing this command, the Jlink set reset pin. However after JLinkExe application quit, the JLink device released the reset and the application loaded in MCU started to execute. I would prefer some kind of non-volatile flag in the JLink device which would tell the JLink to keep the target in reset in case of no app (or using Segger dll) is communicating with it. Or rather keep it in reset if there is no communication over USB (in my case JLink Base). I would be fine even with answer it is not possible to save my time trying to investigate how to do it by reading manuals playing with it. Currently I "think" it is not possible unless there is some undocummented feature in the configuration bytes area (JLinkExe rconf) of the JLink.

    Martin

    Hi,

    You can reset the target using the "r" command in J-Link Commander. Furthermore, J-Link Commander allows to set the state of the reset pin permanently by entering the "r0" and "r1" command. If any addition individualization is required, the J-Link SDK may be interesting. It allows to create customized application using the J-Link API. For further information regarding the J-Link SDK, please refer to: https://www.segger.com/jlink-sdk.html

    - Erik

    Hello,

    I have catched a crash of the JLinkGDBServer. Started with "JLinkGDBServer -device lpc1788 -vd -if SWD",

    "uname -a" - 3.8.0-33-generic #48~precise1-Ubuntu SMP Thu Oct 24 16:28:06 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
    "/etc/issue" - Ubuntu 12.04.3 LTS \n \l
    JLinkARM.dll V4.78j (DLL compiled Nov 22 2013 20:10:51), from the 64-bit package
    uC - LPC1788

    I have opened a second debug session accidentally to en existing previous one.

    Best Martin

    Hello,

    for everyone who is interested in using NXP's chips and this press release http://www.segger.com/cms/admin/uplo…NXP_FlashBP.pdf , this feature has been disabled with the newest firmware.

    Not stated here http://www.segger.com/j-link-release-notes.html, be aware that you cannot use it free of charge.
    (free of charge != evaluation mode)

    From my side, confirmed for LPC2478 and LPC1788.

    Best
    Martin

    To SEGGER: Would be nice to issue a new PR or specify which cores are enabled.

    Hi,

    it happens sometimes (the seg fault), I cannot say exactly what steps are done.

    I can only post my configuration:
    uname -a : Linux ubuntu 3.2.0-54-generic-pae #82-Ubuntu SMP Tue Sep 10 20:29:22 UTC 2013 i686 i686 i386 GNU/Linux

    /etc/issue:Ubuntu 12.04.3 LTS \n \l

    arm-none-eabi-gdb -v: GNU gdb (Sourcery CodeBench 2013.05-53) 7.4.50.20120716-cvs

    Eclipse: Version: Juno Service Release 2, Build id: 20130225-0426
    Zylin Embedded CDT 4.18.1


    Best
    Martin

    Hello,

    could be possible to bind sockets with SO_REUSEADDR? Sometimes the Jlink GDBServer quits with Seg fault and I have to wait until the TIME_WAIT expires. (I do not want to restart my network...).

    ref: http://serverfault.com/questions/3298…et-in-time-wait


    Reading 64 bytes @ address 0x1000A3C0
    Reading 64 bytes @ address 0x1000A380
    Read 2 bytes @ address 0x0000432E (Data = 0x48AC)
    Read 2 bytes @ address 0x00004330 (Data = 0xF003)
    Read 2 bytes @ address 0x00004C94 (Data = 0xF04F)
    GDB closed TCP/IP connection
    Connected to 127.0.0.1
    Segmentation fault (core dumped)
    /var/log/syslog
    Oct 11 12:56:09 ubuntu kernel: [369167.324070] JLinkGDBServer[19062]: segfault at 5257d949 ip 0807161d sp aeec1300 error 4 in JLinkGDBServer[8048000+36000]
    Oct 11 13:35:52 ubuntu kernel: [371551.040183] JLinkGDBServer[24214]: segfault at ffffffff ip 08071121 sp af6f7240 error 5 in JLinkGDBServer[8048000+36000]

    /////////GDBServer launched again

    ERROR: Failed to bind address (Err = 98)
    ERROR: Failed to open listener port 2331


    *** J-Link GDB Server V4.78a Error ***
    Failed to open listener port. GDBServer will be closed.
    *** J-Link GDB Server V4.78a Error ***
    /var/log/syslog
    Oct 11 13:36:28 ubuntu USBBULK[24254]: *** J-Link GDB Server V4.78a
    Error *** | Failed to open listener port. GDBServer will be closed.


    I cannot provide more details about seg fault, the Valgrind is reports
    ==24299== More than 10000000 total errors detected. I'm not reporting any more.
    ==24299== Final error counts will be inaccurate. Go fix your program!
    ==24299== Rerun with --error-limit=no to disable this cutoff. Note
    ==24299== that errors may occur in your program without prior warning from
    ==24299== Valgrind, because errors are no longer being displayed.


    Best
    Martin

    Hi,

    facing the same problem with the newest jlink 32-bit deb package for linux
    SEGGER J-Link Commander V4.78a ('?' for help)
    Compiled Oct 8 2013 13:36:53
    DLL version V4.78a, compiled Oct 8 2013 13:36:49
    Firmware: J-Link ARM V8 compiled Sep 20 2013 15:09:45
    Hardware: V8.00
    hw:Jlink http://segger.com/jlink_base.html

    Even there is stated that the Unlimited Flash Breakpoints is not supported, I am using it with the NXP LPC1788. The device was sold to me with an assurance that the feature is always availaible with the NXP products. It worked until the firmware upgrade.

    Martin

    Hello,

    is it possible to get running DWT counters on SWO with the linux version of JlinkGDBserver v4.7.4?

    Let me explain it.

    By starting the JlinkGDBserver I should be able to read raw SWO data on port 2332. To enable SWO receive in JLink device, I should emit the command SWO EnableTarget x x x x. Probably it configures the JLink device to receive SWO data, ITM, DWT (as shown in the JLink manual (Example code for enabling SWO out of the target application). This configuration can overrides my settings for DWT, ITM (e.g. global timestamps) etc.

    There is a command SWO start x x. Is it possible to use this command to enable forwarding of the JLink SWO to the port 2332?

    Why I am asking: I would like to use the SWO Analyzer app (not using J-Link config) and problably implement own on-line parser in the future.

    Martin

    Hello,

    I am facing a problem on NXP LPC1788 with reading content of the EMAC registers.
    Any attempt to read the content fails with WARNING: Failed to read cacheable memory @ address ADDRESS(e.g.0x20084000, EMAC1).

    My configuration: LPC1788, Ubuntu 12.04, JLinkGDBServer v 4.74 command line "-device LPC1788 -vd -log status.log", Eclipse Juno CDT C/C++, OpenJDK, J-Link
    Firmware: J-Link ARM V8 compiled Jul 17 2013 11:24:15, Hardware: V8.00

    My observations:
    Reading by using JLinkExe, mem32 0x20084000, 1 - success
    Reading by using JLinkExe, mem32 0x20084000, 256 - fails (Could not read memory.)

    From the JLinkGDB log, I can see attempt to read 256 items even if the request requires only 4.
    02-00-00020007-00AA: TB2EBAB40 019:994 JLINK_ReadCodeMem(0x20084000, 0x0004 Bytes, ...) -- CPU_ReadMem(256 bytes @ 0x20084000) -- Data: 00 00 01 10 returns 0xFFFFFFFF (0013ms, 2981ms total)
    03-00-00020007-003D: WARNING: Failed to read cacheable memory @ address 0x20084000
    03-00-00020007-0035: Read 4 bytes @ address 0x20084000 (Data = 0x10010000)

    To the Eclipse is returned - failed.

    The question is: Can I set the read size to respect the request?

    Best
    Martin

    Do you plan to support overriding(overloading) some set of GDB q packets?
    Here is a use case what I mean.

    GDB hardware debugging server from eclipse sends a packet with qfThreadInfo to get list of threads. There is running a FreeRTOS on the target hardware. The Jlink GDB passes this query to a user script which returns result back to eclipse GDB to show a thread list. The details of passing and script language are irrelevant, it is just an idea how it could work.

    Best
    Martin

    Hello,

    I have a question about flash download to NXP lpc1857 via Jlink GDB Server. I do not have this microcontroller in my hand, so more or less this is a preliminary question...

    The micro has got two flash banks, A and B, in a non-continuous memory address space,
    A starts at 0x1A000000, size 512KB
    B starts at 0x1B000000, size 512KB

    There is implemented a shadow memory area starting at 0x00000000 which can be, via a special register, mapped to e.g. beginning of the flash bank A. Thus it is possible to write a code with starting at addr. 0x000000, linker script with rom0 (rx) : ORIGIN = 0x00000000, LENGTH = 512K, rom1 (rx) : ORIGIN = 0x01000000, LENGTH = 512K.

    It is only my assumption that JLink uses IAP for LPC and I cannot image flash download via the GDB load command. Does Jlink GDB server provide reallocation based on the content of the M3MEMMAP register? Or should I provide it by myself by setting VMA and LMA in the linker script?

    Here is a use case:
    M3MEMMAP = 0x1A000000, 0x00000000 is mapped to the beginning of the flash bank A
    GDB client asks for downloading 1KB to the address 0x00000000.
    ?? Jlink flash code prepares sector 0 or fails because no flash is defined at this address
    ?? Jlink flash code fills IAP Copy RAM to Flash with Param0(DST): = 0x00000000 ==> fails with DST_ADDR_NOT_MAPPED

    Thank you for clarification

    Martin

    P.S.
    I would like to stick to rom0 (rx) : ORIGIN = 0x00000000 instead of rom0 (rx) : ORIGIN = 0x1A000000 for many of reasons, e.g. code portability, code size, etc.

    Hello,

    I would like to add my experience with programming an external Spansion NOR Flash on NXP LPC2478.

    Be carefull during writting parameters to the GDB Server. I made a mistake the flash was 16MB and I set a lower address range -> 8MB
    (monitor flash CFI = 0x80000000-0x80FFFFFF). (Un)fortunately JLink software reads CFI info to perform write/erase timing and number of sectors etc. This led to a confusion of the JLink (GDBServer assumed 8MB, CFI 16MB) with a result: ERROR: Programming failed @ address 0x81000000 (item verification error).

    Based on this experience I assume you cannot virtualy divide the flash into two partitions, one for code 8MB, second for data.

    Best
    Martin

    [edit]
    corrected grammatical discrepancy