• Good day

    I built espruino_2v24_stm32f4discovery.elf which this command line:

    ~/Espruino > BOARD=STM32F4DISCOVERY DEBUG=1 make
    

    my .gdbinit:

    ## on load
    b Reset_Handler
    b SystemInit
    b main
    monitor reset halt
    

    When I try to load .elf file into the gdb I got some strange address binding for source code lines:
    0x3930 (without startup_stm32f4xx.s link)
    0x58324
    0x35076

    It looks like address bindings to Flash ROM are totally incorrect.

    At the same time, when I build my own empty startup code (generated by latest CubeMX), there are no any problems with addresses or source code.

    Next, another problem is I always got system stopped at 0x800076c address that looks like start of EXTI0_IRQHandler


    1 Attachment

    • 241201_123519.png
  • targets/stm32/jshardware.c

      // Remap system memory to address 0x0000 0000 in address space
    [#ifdef](https://forum.espruino.com/search/?q=%23ifdef) STM32F4
        SYSCFG->MEMRMP = 0x01;
    [#endif](https://forum.espruino.com/search/?q=%23endif)
    
  • Yes, mapping to address 0 is not "totally incorrect", it is normal, so is there something else that is wrong? Maybe it just stops at breakpoints that you have set?

  • You can change the linker file to get all the elf files to point to 0x00.. like this https://github.com/espruino/Espruino/blob/d6e543beec98b55cb4d00bed39cb9dab7fd53790/boards/NUCLEOF401RE.py#L51

    But IIRC it's better having them 0-based because then the addresses only take up ~18 bits or so and are easier to store

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

debug (trace) Espruino core run under gdb-multiarch (arm-none-eabi-gdb)

Posted by Avatar for dponyatov @dponyatov

Actions