Wednesday, May 23rd 2018, 7:25am UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

mingfeng_wu

Beginner

Date of registration: Mar 22nd 2018

Posts: 11

1

Friday, April 20th 2018, 6:13am

Error occurs when using external toolchain with Embedded Studio

Hi,

I follow this link(https://wiki.segger.com/How_to_use_an_ex…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

This post has been edited 2 times, last edit by "mingfeng_wu" (Apr 20th 2018, 6:16am)


SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

2

Friday, April 20th 2018, 8:59am

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? https://wiki.segger.com/How_to_use_an_ex…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: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
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 contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/


mingfeng_wu

Beginner

Date of registration: Mar 22nd 2018

Posts: 11

3

Tuesday, April 24th 2018, 10:32am

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

This post has been edited 1 times, last edit by "mingfeng_wu" (Apr 24th 2018, 10:34am)


mingfeng_wu

Beginner

Date of registration: Mar 22nd 2018

Posts: 11

4

Wednesday, April 25th 2018, 12:30pm

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
mingfeng_wu has attached the following files:
  • Vedio2.7z (1.03 MB - 28 times downloaded - Last download: May 21st 2018, 8:00pm)
  • Project2.7z (69.16 kB - 31 times downloaded - Last download: May 21st 2018, 8:00pm)

This post has been edited 1 times, last edit by "mingfeng_wu" (Apr 25th 2018, 12:35pm)


SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

5

Friday, April 27th 2018, 9:10am

Hello Wilson,

Quoted

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?

Quoted

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: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
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 contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/


mingfeng_wu

Beginner

Date of registration: Mar 22nd 2018

Posts: 11

6

Friday, May 4th 2018, 9:38am

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/C++ Source code

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

    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

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 1,048

7

Tuesday, May 8th 2018, 9:09am

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: https://wiki.segger.com/Adding_Support_for_New_Devices
How to add the flash loader to Embedded Studio is described here: https://wiki.segger.com/Using_Flashloade…_different_IDEs

Best regards,
Nino
Please read the forum rules before posting: Forum Rules

Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
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 contact us per e-mail.
The following contact form can be used for this: https://www.segger.com/about-us/contact-us/


mingfeng_wu

Beginner

Date of registration: Mar 22nd 2018

Posts: 11

8

Friday, May 11th 2018, 11:49am

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