pico-sdk icon indicating copy to clipboard operation
pico-sdk copied to clipboard

Please add support for Keil

Open myjtag opened this issue 2 years ago • 7 comments

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.

myjtag avatar Jun 21 '22 11:06 myjtag

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

GorgonMeducer avatar Jun 30 '22 23:06 GorgonMeducer

Hi But you are under valuing the Keil tool chain, if you add support for it, I guarantee your sales would be boosted by 2-3X

Best Regards

On Fri, Jul 1, 2022 at 4:19 AM Gabriel Wang @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/raspberrypi/pico-sdk/issues/877#issuecomment-1171777452, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECNZSP5ZPJJDUVOS7IZAUDVRYW7XANCNFSM5ZMAQAMQ . You are receiving this because you authored the thread.Message ID: @.***>

-- دوست دار شما علی اسدزاده

myjtag avatar Jul 03 '22 06:07 myjtag

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

We are looking in to alternative toolchains.

JamesH65 avatar Jul 03 '22 09:07 JamesH65

I've been using Keil for more than 10 years,and it's the standard tool for Cortex M development, and I know they have many users, also they have released the free version a few months ago, before that we had many many many users with cracks! So I think My guess is not that ambitious.

I hope you would assign some team members to add the official support for keil too.

Best Regards

On Sun, Jul 3, 2022 at 2:28 PM James Hughes @.***> wrote:

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

We are looking in to alternative toolchains.

— Reply to this email directly, view it on GitHub https://github.com/raspberrypi/pico-sdk/issues/877#issuecomment-1173050208, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECNZSK74SEMLZZU5FC67FDVSFP5HANCNFSM5ZMAQAMQ . You are receiving this because you authored the thread.Message ID: @.***>

-- دوست دار شما علی اسدزاده

myjtag avatar Jul 04 '22 10:07 myjtag

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...

bgolab avatar Jul 14 '22 08:07 bgolab

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.

JamesH65 avatar Jul 14 '22 08:07 JamesH65

Thanks, for the update, I hope we will see the official support sooner. Regards

On Thu, Jul 14, 2022 at 1:05 PM James Hughes @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/raspberrypi/pico-sdk/issues/877#issuecomment-1184160320, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECNZSNBVSYSOWVSGOHGDMDVT7GLVANCNFSM5ZMAQAMQ . You are receiving this because you authored the thread.Message ID: @.***>

-- دوست دار شما علی اسدزاده

myjtag avatar Jul 18 '22 09:07 myjtag

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

bgolab avatar Mar 15 '23 18:03 bgolab

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

GorgonMeducer avatar Mar 15 '23 19:03 GorgonMeducer

Dear Raspberrypi/Pico-Sdk Hi, Thanks for the update.

Best regards

On Wed, Mar 15, 2023 at 11:24 PM Gabriel Wang @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/raspberrypi/pico-sdk/issues/877#issuecomment-1470749060, or unsubscribe https://github.com/notifications/unsubscribe-auth/AECNZSPBAIJ4YM4EG272E4TW4IM5XANCNFSM5ZMAQAMQ . You are receiving this because you authored the thread.Message ID: @.***>

-- دوست دار شما علی اسدزاده

myjtag avatar Mar 16 '23 07:03 myjtag

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

will-v-pi avatar May 21 '24 14:05 will-v-pi

Thank you for letting me know.

I wonder if you tested the PICO basic example (the one delivered within DFP) on Keil with Community Licence enabled: https://www.keil.arm.com/mdk-community/

I use fresh Keil 5.39.0.0 installation with the Community License activated as per the link above.

In my case I got to many compilation errors to proceed.

I wonder If you could share some details how this basic example was tested.

Thank you.

bgolab avatar May 21 '24 16:05 bgolab

It has been tested in Keil uVision 5.39.0.0 with the Community License on Windows 11 and works fine, with no compilation errors. Did you install the DFP through the Pack Installer, and then copy the example from that?

The test process was simply to install uVision, use the Pack Installer to install the DFP, and then use the Pack Installer to copy the example and build/run it

will-v-pi avatar May 21 '24 16:05 will-v-pi

Yes, I followed standard approach through the Pack installer then copied the basic example like I do for other MCUs like STM32. Win10.

Did you install all optional components available in the Pack Installer? I mean optional stuff like tensor flow etc? OR what minimal components are enough apart from DFP and at least CMSIS stuff...

Will try again then.

Thank you.

bgolab avatar May 21 '24 16:05 bgolab

I didn't install anything other than the RP2xxx_DFP, so no other optional components. The example project has the required components for it selected by default, which are

  • CMSIS
    • Core
  • Compiler
    • Event Recorder (DAP)
    • I/O
      • STDOUT (EVR)
  • Device
    • Startup
    • Pico Board (Pico)
    • Pico SDK

The Event Recorder is just for the retargeted stdout so it can be read over the SWD connection

will-v-pi avatar May 21 '24 17:05 will-v-pi

  1. I reinstalled Keil uVision (previously removed it).
  2. I removed ALL packs located at: C:\users%username%\AppData\Local\Arm\Packs
  3. selected RP2040 and install Rp2040 DFP.
  4. Copied PICO example
  5. added missing components automatically (CMSIS, etc). I do not see and Pack dependencies errors anymore.

I tried to compile the PICO example and got 92 errors with repeating sections like this: Build started: Project: rp2040_example *** Using Compiler 'V6.21', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin' Build target 'Pico' compiling env_wrapper.c... C:/Users/abg015/AppData/Local/Arm/Packs/RaspberryPi/RP2xxx_DFP/0.9.4/pico-sdk/src/common/pico_sync/lock_core.c(7): warning: In file included from... C:/Users/abg015/AppData/Local/Arm/Packs/RaspberryPi/RP2xxx_DFP/0.9.4/pico-sdk/src/common/pico_sync/include\pico/lock_core.h(12): warning: In file included from... C:/Users/abg015/AppData/Local/Arm/Packs/RaspberryPi/RP2xxx_DFP/0.9.4/pico-sdk/src/rp2_common/hardware_sync/include\hardware/sync.h(118): error: static declaration of '__builtin_arm_sev' follows non-static declaration 118 | __force_inline static void __sev(void) { | ^ ././RTE/Device/RP2040_Core0/env_wrapper.h(177): note: expanded from macro '__sev' 177 | #define __sev __builtin_arm_sev | ^ C:\Keil_v5\ARM\ARMCLANG\Bin..\include\arm_acle.h(52): note: '__builtin_arm_sev' is a builtin with type 'void (void)' 52 | __builtin_arm_sev();


Maybe your setup had some packs already installed - before you started Keil installation - when you remove the Keil uVisions the packs are NOT removed automatically...

bgolab avatar May 21 '24 18:05 bgolab

The test process was simply to install uVision, use the Pack Installer to install the DFP, and then use the Pack Installer to copy the example and build/run it

I have just retried these steps on a clean Windows 11 install, and it worked fine, so I'm not sure what's causing your issues

will-v-pi avatar May 21 '24 18:05 will-v-pi

@bgolab Which cmsis version do you use? Can you give us a screenshot about your RTE view.

I can replicate the issue you encountered. Please select cmsis 5.9.0 as a workaround. The issue you encountered is caused by the latest cmsis 6.0.0 and 6.1.0

image

GorgonMeducer avatar May 21 '24 22:05 GorgonMeducer

I managed to fix the issue with the following changes:

image

image

After adding those changes, it is possible to get along with both cmsis 5.9.0 and cmsis 6.x.0

GorgonMeducer avatar May 21 '24 23:05 GorgonMeducer

@GorgonMeducer Related to #1710 , or is that something entirely different?

lurch avatar May 21 '24 23:05 lurch

@lurch Sorry, after double check, it is the same.

But there are something missing as shown here:

image

GorgonMeducer avatar May 21 '24 23:05 GorgonMeducer

@bgolab @will-v-pi I have created an fixed pack, please have a try.

RaspberryPi.RP2xxx_DFP.0.9.5-dev.pack.zip

NOTE: this isn't an official release.

After install this cmsis-pack, you need to update the env_wrapper.h as shown below:

image

GorgonMeducer avatar May 21 '24 23:05 GorgonMeducer

  1. I use brand new Keil 5.39.0.0 installation, with CMSIS 6.1.0. The default installation. I cannot figure out why in my case I failed but in case of @will-v-pi (if the same CMSIS version was really used) everything is fine? What's the difference?

  2. @GorgonMeducer Yes, selecting CMSIS 5.9.0 fixes the problem. Thank you.

bgolab avatar May 22 '24 05:05 bgolab

I can confirm that I was using a slightly older installer of uVision, which still installed uVision 5.39.0.0, but defaulted to CMSIS version 5.9.0 rather than 6.1.0, which was causing the discrepancy. Will update the pack to work with 6.1.0

Edit: It looks like I was using the current version of the installer, it just installs 5.9.0 by default rather than 6.1.0 on my system, so I'm not sure why @bgolab gets 6.1.0 by default when I get 5.9.0?

will-v-pi avatar May 22 '24 09:05 will-v-pi

Yes, in my case I had to install CMSIS 5.9.0 manually. The 6.1.0 was out of the box.

bgolab avatar May 22 '24 10:05 bgolab

@bgolab can you check whether the cmsis-pack I attached could solve the problem or not?

GorgonMeducer avatar May 22 '24 10:05 GorgonMeducer

so I'm not sure why @bgolab gets 6.1.0 by default when I get 5.9.0?

When people run pack-installer and see there is newer version of cmsis-pack, it is normal to click the update button.

And Arm recommends people to use the latest cmsis also.

GorgonMeducer avatar May 22 '24 10:05 GorgonMeducer

I wrote earlier that CMSIS 5.9.0 fixes the issue.

bgolab avatar May 22 '24 10:05 bgolab

More interesting problem - if you change the linker setting and try to link the code to SRAM area you will get some errors: _Build started: Project: test1 *** Using Compiler 'V6.21', folder: 'C:\Keil_v5\ARM\ARMCLANG\Bin' Build target 'Pico' linking... .\Objects\rp2040_example.axf: Error: L6915E: Library reports error: __use_no_semihosting was requested, but __user_initial_stackheap was referenced .\Objects\rp2040_example.axf: Error: L6915E: Library reports error: The semihosting _user_initial_stackheap cannot reliably set up a usable heap region if scatter loading is in use Not enough information to list load addresses in the image map. Finished: 1 information, 0 warning and 2 error messages. ".\Objects\rp2040_example.axf" - 2 Error(s), 0 Warning(s). Target not created.

image

bgolab avatar May 22 '24 10:05 bgolab

@bgolab

I wrote earlier that CMSIS 5.9.0 fixes the issue.

I mean using the latest cmsis-pack (i.e. 0.9.5-dev) and work with cmsis 6.1.0

For the issue you encountered, please send the linker script you modified. Based on the error info from compiler, you might have removed the ARM_LIB_STACK and ARM_LIB_HEAP region in the linker script.

You can try this one:

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

GorgonMeducer avatar May 22 '24 12:05 GorgonMeducer