[SOLVED] Error occurs when using external toolchain with Embedded Studio

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

  • [SOLVED] Error occurs when using external toolchain with Embedded Studio

    Hi,

    I follow this link(wiki.segger.com/How_to_use_an_…hain_with_Embedded_Studio) to use an external toolchain with Embedded Studio.
    I am using:
    • Embedded Studio 3.34a
    • ARM GCC 7-2017-q4-major
    • Select Target Device: Cortex-M0
    • Change Tool Chain Directory to ARM GCC 7-2017-q4-major
    • Buid project in "Debug External" build configuration

    But I got errors when assembling 'startup_ARMCM_GCC.S'


    And this is my project: Executable_1.7z

    Any advice about this build error? I would be grateful for any suggestions.



    Best Regards
    Wilson

    The post was edited 2 times, last by mingfeng_wu ().

  • Hello Wilson,

    Thank you for your inquiry.
    When setting up the project how did you proceed?
    Did you follow the steps described in our Wiki? wiki.segger.com/How_to_use_an_…hain_with_Embedded_Studio

    We looked at the project you supplied. There you are using the startup_ARMCM_GCC.S which is not compatible with Cortex-M0 but with Cortex-M4.
    To make your project build you will need to include a startup that is compatible to your external linker script and core.
    Unfortunately we do not supply such files and can't offer support for external build startups as they are not generic.
    We recommend using the internal GCC of Embedded Studio with the sources of your project.

    Best regards,
    Nino
    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.
  • Hello Nino,

    Thank you for your help.
    Yes, I followed the steps described in Wiki. My steps are in Video.7z.
    But the "startup_ARMCM_GCC.S" which Embedded Studio project wizard generated is not for Cortex-M0 but for Cortex-M4.

    Question 1:
    Are there something wrong when I create project? Why do I select Cortex-M0 device but get "startup_ARMCM_GCC.S" for Cortex-M4?

    In the same project(using the same external toolchain, GNU ARM Toolchain), it can build successfully if I change "ARM Core Type" from Cortex-M0 to Cortex-M4.(Porject->Edit Options->Code->Code Generation->ARM Core Type)


    Question 2:
    As you said, project wizard can't offer support for external build startups. But why can create project for Cortex-M4?

    Best regards,
    Wilson

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

  • Hi Nino,

    It's another problem.
    I use the internal GCC of Embedded Studio. But why program can't stop at start of main function?
    This is the result after I press F5. The cursor stops at 0x1000043A.

    Best regards,
    Wilson
    Files
    • Vedio2.7z

      (1.03 MB, downloaded 469 times, last: )
    • Project2.7z

      (69.16 kB, downloaded 397 times, last: )

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

  • Hello Wilson,

    Are there something wrong when I create project? Why do I select Cortex-M0 device but get "startup_ARMCM_GCC.S" for Cortex-M4?

    When creating an external project you will currently only get a M4 configuration as this is the only one supplied by us. This is meant to be a guideline how to do it for other Arm cores as well.
    If you need it for another core you need to get it somewhere else.
    We strongly suggest using the internal compiler from Embedded Studio which is also GCC based to avoid any issues with incorrect buildsteps etc.

    What hardware are you trying to program?
    Is is an eval board or custom hardware?

    I use the internal GCC of Embedded Studio. But why program can't stop at start of main function?

    Is a memory area starting at 0x10000000 available on the chip you are trying to debug?
    If this is no valid RAM/ROM then it would explain the error.
    In this case edit the section placement and memory map to fit to your specific device.

    Best regards,
    Nino
    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.
  • Hi Nino:

    Thank you for your advice. My program can stop at start of main function now.

    Now, I want to download code and data by flash loader.
    • I use the internal GCC of Embedded Studio to build my project.
    • My device is Cortex-M0 based device.
    • My project is here: Executable_1.7z. It can build success.
    • JLinkDevices.xml is here: JLinkDevices.7z.
    • Two flash loaders are here: MyDevice.7z. One is for internal flash(0x00000000-0x00010000) and another is for external flash(0x60000000-0x00800000). And they are working well in Keil uVision 5 + J-Link.
    • Here is J-Link log(JLinkLog.txt).
    In this project, I add a new memory segment and place some data in it.
    • Memory Segment Option:

      C Source Code

      1. EXT_FLASH RWX 0x60200000 0x00600000
    • Add ".ext_flash" ProgramSection in flash_placement.xml.
    • main.c:

      C Source Code

      1. __attribute__((section(".ext_flash"))) int newMemory[4] = {0x22, 0x33, 0x44, 0x55};
    According to above setup, download is successful in internal flash but not in external flash.
    And J-Link log shows error message:
    ***** Error: Timeout while Verifying sector, core does not stop. (PC = 0x20002468, CPSR = 0xFFFFFFFF, LR = 0x61000003)! -- End of comparing flash -- Start of restoring -- End of restoring -- Bank 1 @ 0x60000000: Skipped. Contents already match -- Bank 1 @ 0x60000000: Skipped. Contents already match returns 0xFFFFFFFE (18119ms, 18697ms total)

    I am probably doing something wrong. Can you give me any suggestions of what I am doing wrong?

    Best regards,
    Wilson
  • Hello Wilson,

    Did you create a flash loader for the external Flash that is compatible to J-Link?
    How to add support for new devices is described here: wiki.segger.com/Adding_Support_for_New_Devices
    How to add the flash loader to Embedded Studio is described here: wiki.segger.com/Using_Flashloader_with_different_IDEs

    Best regards,
    Nino
    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.
  • Hi Nino:

    Thank you for your advice and sorry for the late reply.

    It seems that there is something wrong in my verify function(flash loader for external flash).
    Download is successful if I remove verify function from external flash loader.

    After reading J-Link log, I found J-Link still verify external flash.
    Does it mean that J-Link uses its own verify function if my flash loader doesn't support verify function?

    Best regards,
    Wilson