Skip to content

Please add support for Keil #877

Open

Description

@myjtag

Hi,
Since we have lots of libraries and code on ARM Keil tools, it would be very helpful if you could add support for it.

Activity

  1. GorgonMeducer commented on Jun 30, 2022

    @GorgonMeducer
    Contributor

    Please let the Pico team concentrate on what they should do. They don't have sufficient resources to add support for MDK.

    For MDK support, please try this one:

    https://github.com/GorgonMeducer/Pico_Template

  2. myjtag commented on Jul 3, 2022

    @myjtag
    Author
  3. JamesH65 commented on Jul 3, 2022

    @JamesH65
    Contributor

    That is a very ambitious claim since you don't actually know what our sales actually are...

    We are looking in to alternative toolchains.

  4. myjtag commented on Jul 4, 2022

    @myjtag
    Author
  5. added this to the none milestone on Jul 11, 2022
  6. bgolab commented on Jul 14, 2022

    @bgolab

    I am also interested in Keil support as I am heavy user of Keil for STM32 and so on.

    I tried some some you can find here:
    https://github.com/GorgonMeducer/Pico_Template

    So some ground works is already done...

  7. JamesH65 commented on Jul 14, 2022

    @JamesH65
    Contributor

    This is being looked in to. We do need support from ARM for certain things, which they will not be able to provide until the end of the year, unfortunately. In the meantime, lots of the toolchain already works.

  8. myjtag commented on Jul 18, 2022

    @myjtag
    Author
  9. bgolab commented on Mar 15, 2023

    @bgolab

    I wonder if there is any update on this issue available.

  10. GorgonMeducer commented on Mar 15, 2023

    @GorgonMeducer
    Contributor

    @bgolab, The latest version of Pico-Template now supports flash downloading in MDK.
    Please feel free to have a try.

  11. myjtag commented on Mar 16, 2023

    @myjtag
    Author
  12. will-v-pi commented on May 21, 2024

    @will-v-pi
    Contributor

    We have now released an RP2xxx_DFP, which should work as a CMSIS solution for Keil tools. Feel free to give that a go and see if it works for you

  13. 37 remaining items

  14. GorgonMeducer commented on May 23, 2024

    @GorgonMeducer
    Contributor

    Linker tab: I see that you set R/O base to 0x0000000 whereas I had 0x10000000 when failed.

    Once we use linker script, this kind of option won't affect the final result.

    Got the same errors.

    Can you pass me the map file?

    This time I would like to use the official release to compare.

    As I mentioned above, I have updated the Pico-Template to use official RP2xxx_DFP. The reason I asked you to try it is because this could become the common example project for us to understand the reason behind the issue you encountered.

  15. bgolab commented on May 23, 2024

    @bgolab

    rp2040_example.map.txt
    renamed to txt to upload...

  16. GorgonMeducer commented on May 23, 2024

    @GorgonMeducer
    Contributor

    @bgolab Can you attach the linker script also? The reason I ask this is because, the map file looks strange.
    I know you suppose to use the linker script I provided, but just in case, please send me the one you actually uses

    Memory Map of the image
    
      Image Entry point : 0x200000c1
    
      Load Region LR_IROM1 (Base: 0x20000000, Size: 0x000052e0, Max: 0x0003e000, ABSOLUTE)
    
        Execution Region ER_BINRAY_INFO (Exec base: 0x20000000, Load base: 0x20000000, Size: 0x00000000, Max: 0xffffffff, ABSOLUTE)
    
        **** No section assigned to this execution region ****
    
    
        Execution Region ER_FLASH (Exec base: 0x20000000, Load base: 0x20000000, Size: 0x00000900, Max: 0xffffffff, ABSOLUTE)
    
        Exec Addr    Load Addr    Size         Type   Attr      Idx    E Section Name        Object
    
        0x20000000   0x20000000   0x000000c0   Data   RO          709    RESET               lto-llvm-5f2a3e.o
        0x200000c0   0x200000c0   0x00000008   Code   RO          220  * !!!main             c_p.l(__main.o)
        0x200000c8   0x200000c8   0x00000054   Code   RO          729    !!!scatter          c_p.l(__scatter.o)
        0x2000011c   0x2000011c   0x0000001a   Code   RO          733    !!handler_copy      c_p.l(__scatter_copy.o)
    

    This is the one on myside:

    Memory Map of the image
    
      Image Entry point : 0x20000001
    
      Load Region LR_IROM1 (Base: 0x20000000, Size: 0x00005430, Max: 0x0003e000, ABSOLUTE)
    
        Execution Region ER_BINRAY_INFO (Exec base: 0x20000000, Load base: 0x20000000, Size: 0x0000002c, Max: 0xffffffff, ABSOLUTE)
    
        Exec Addr    Load Addr    Size         Type   Attr      Idx    E Section Name        Object
    
        0x20000000   0x20000000   0x0000002c   Code   RO          751  * .text.Reset_Handler  lto-llvm-483d6d.o
    
    
        Execution Region ER_RAM_VECTOR_TABLE (Exec base: 0x20000100, Load base: 0x20000100, Size: 0x00000000, Max: 0xffffffff, ABSOLUTE)
    
        **** No section assigned to this execution region ****
    
    
        Execution Region ER_FLASH (Exec base: 0x20000100, Load base: 0x20000100, Size: 0x00000858, Max: 0xffffffff, ABSOLUTE)
    
        Exec Addr    Load Addr    Size         Type   Attr      Idx    E Section Name        Object
    
        0x20000100   0x20000100   0x000000c0   Data   RO          795    RESET               lto-llvm-483d6d.o
        0x200001c0   0x200001c0   0x00000008   Code   RO          268  * !!!main             c_p.l(__main.o)
        0x200001c8   0x200001c8   0x00000054   Code   RO          834    !!!scatter          c_p.l(__scatter.o)
        0x2000021c   0x2000021c   0x0000001a   Code   RO          838    !!handler_copy      c_p.l(__scatter_copy.o)
    

    You might notice that the key difference is the Reset_Handler is placed at the start of the 0x20000000

        Exec Addr    Load Addr    Size         Type   Attr      Idx    E Section Name        Object
    
        0x20000000   0x20000000   0x0000002c   Code   RO          751  * .text.Reset_Handler  lto-llvm-483d6d.o
    

    This is the key difference.

    image

    In your map file, I found this:

    Reset_Handler                            0x200031e9   Thumb Code    24  lto-llvm-5f2a3e.o(.text.Reset_Handler)
    

    This is the location of Reset_Handler in my map file:

    Reset_Handler                            0x20000001   Thumb Code    24  lto-llvm-483d6d.o(.text.Reset_Handler)
    

    Based on this, I really want to check the linker script you actually use.

  17. bgolab commented on May 23, 2024

    @bgolab

    Current settings of the Linker tab and latest / freshest file (BTW. I have not touched the content of the linker file):
    image

    [RP2040_debug_in_sra
    rp2040_example.map.txt
    m.sct.txt](https://github.com/raspberrypi/pico-sdk/files/15417662/RP2040_debug_in_sram.sct.txt)

  18. GorgonMeducer commented on May 23, 2024

    @GorgonMeducer
    Contributor

    @bgolab You are not using the latest RP2040_debug_in_sram.sct

    Please use the latest one.

    https://github.com/GorgonMeducer/Pico_Template/blob/main/project/mdk/RP2040_debug_in_sram.sct

    It is different from the one you currently using.

    Thank you.

    This is the one you using:

    image

    This is the latest one:

    image

  19. bgolab commented on May 23, 2024

    @bgolab

    I lost control of this. This time should be ok:

    Program Size: Code=18804 RO-data=2152 RW-data=260 ZI-data=41148
    After Build - User command #2: C:/Users/abg015/AppData/Local/Arm/Packs/RaspberryPi/RP2xxx_DFP/0.9.4/tools\elf2uf2.exe "C:\Users\abg015\Documents\Keil\test1-sram\Objects\rp2040_example.axf" ".\rp2040_example.uf2"
    ERROR: A RAM binary should have an entry point at the beginning: 20000001 (not 20000181)
    ".\Objects\rp2040_example.axf" - 0 Error(s), 0 Warning(s).

    RP2040_debug_in_sram.sct.txt

  20. bgolab commented on May 23, 2024

    @bgolab
  21. GorgonMeducer commented on May 23, 2024

    @GorgonMeducer
    Contributor

    @bgolab I managed to replicate the same issue on myside, please add --entry=Reset_Handler to the Misc Controls in the linker tab as shown below:

    image

    Without this option:

    Memory Map of the image
    
      Image Entry point : 0x200000c1
    
      Load Region LR_IROM1 (Base: 0x20000000, Size: 0x00005358, Max: 0x0003e000, ABSOLUTE)
    
        Execution Region ER_BINRAY_INFO (Exec base: 0x20000000, Load base: 0x20000000, Size: 0x00000000, Max: 0xffffffff, ABSOLUTE)
    
        **** No section assigned to this execution region ****
    
    
        Execution Region ER_RAM_VECTOR_TABLE (Exec base: 0x20000000, Load base: 0x20000000, Size: 0x00000000, Max: 0xffffffff, ABSOLUTE)
    
        **** No section assigned to this execution region ****
    
    
        Execution Region ER_FLASH (Exec base: 0x20000000, Load base: 0x20000000, Size: 0x00000858, Max: 0xffffffff, ABSOLUTE)
    
        Exec Addr    Load Addr    Size         Type   Attr      Idx    E Section Name        Object
    
        0x20000000   0x20000000   0x000000c0   Data   RO          795    RESET               lto-llvm-f71e40.o
        0x200000c0   0x200000c0   0x00000008   Code   RO          268  * !!!main             c_p.l(__main.o)
        0x200000c8   0x200000c8   0x00000054   Code   RO          834    !!!scatter          c_p.l(__scatter.o)
        0x2000011c   0x2000011c   0x0000001a   Code   RO          838    !!handler_copy      c_p.l(__scatter_copy.o)
        0x20000136   0x20000136   0x00000002   PAD
        0x20000138   0x20000138   0x00000002   Code   RO          835    !!handler_null      c_p.l(__scatter.o)
        0x2000013a   0x2000013a   0x00000002   PAD
        0x2000013c   0x2000013c   0x0000001c   Code   RO          840    !!handler_zi        c_p.l(__scatter_zi.o)
    

    With this option:

    Memory Map of the image
    
      Image Entry point : 0x20000001
    
      Load Region LR_IROM1 (Base: 0x20000000, Size: 0x00005430, Max: 0x0003e000, ABSOLUTE)
    
        Execution Region ER_BINRAY_INFO (Exec base: 0x20000000, Load base: 0x20000000, Size: 0x0000002c, Max: 0xffffffff, ABSOLUTE)
    
        Exec Addr    Load Addr    Size         Type   Attr      Idx    E Section Name        Object
    
        0x20000000   0x20000000   0x0000002c   Code   RO          751  * .text.Reset_Handler  lto-llvm-ed53d8.o
    
    
        Execution Region ER_RAM_VECTOR_TABLE (Exec base: 0x20000100, Load base: 0x20000100, Size: 0x00000000, Max: 0xffffffff, ABSOLUTE)
    
        **** No section assigned to this execution region ****
    
    
        Execution Region ER_FLASH (Exec base: 0x20000100, Load base: 0x20000100, Size: 0x00000858, Max: 0xffffffff, ABSOLUTE)
    
        Exec Addr    Load Addr    Size         Type   Attr      Idx    E Section Name        Object
    
        0x20000100   0x20000100   0x000000c0   Data   RO          795    RESET               lto-llvm-ed53d8.o
        0x200001c0   0x200001c0   0x00000008   Code   RO          268  * !!!main             c_p.l(__main.o)
        0x200001c8   0x200001c8   0x00000054   Code   RO          834    !!!scatter          c_p.l(__scatter.o)
        0x2000021c   0x2000021c   0x0000001a   Code   RO          838    !!handler_copy      c_p.l(__scatter_copy.o)
        0x20000236   0x20000236   0x00000002   PAD
        0x20000238   0x20000238   0x00000002   Code   RO          835    !!handler_null      c_p.l(__scatter.o)
        0x2000023a   0x2000023a   0x00000002   PAD
    
  22. bgolab commented on May 23, 2024

    @bgolab

    Yes, the '--entry=Reset_Handler' magic setting helped. It looks like not everything is controlled by the sct.

    The old-way of controlling linker settings in such simple scenario like this (just moving the code region to SRAM area) wasn't so bad;)

    Thank you.

  23. bgolab commented on May 23, 2024

    @bgolab

    UF2 verified by my script that the code is located in SRAM:
    rp2040_example.uf2.log

  24. GorgonMeducer commented on May 23, 2024

    @GorgonMeducer
    Contributor

    @bgolab You mixed different things up.

    The old-way of controlling linker settings in such simple scenario like this (just moving the code region to SRAM area) wasn't so bad;)

    The Old way won't help.

    This is because RP2040 BOOTROM only wants the Reset_Handler to be located at a specific location. This is different from STM32, which always read Reset_handler address from the vector table (RESET section in our case).

    The so called old way or new way only affects how the STACK and HEAP are configured.

  25. bgolab commented on May 23, 2024

    @bgolab

    Yes, I see. Got used to STM32;)

  26. GorgonMeducer commented on May 23, 2024

    @GorgonMeducer
    Contributor

    Current solution, i.e. using --entry=Reset_Handler is just a workaround. PRi team needs a more elegant way to place Reset_Handler at 0x2000-0000

  27. bgolab commented on May 23, 2024

    @bgolab

    It looks like the RP2 is not officially supported yet:
    https://www.keil.com/dd/

  28. GorgonMeducer commented on May 23, 2024

    @GorgonMeducer
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions