8 years, 4 months ago.

Yotta SAMR21 Build

Hi All,

I am new to the mbed community and am trying to get basic "blinky" examples running on my SAMR21 X-Plained PRO dev board. I have successfully built the blinky example using the mbed online compiler. I am trying to do the same thing with yotta with some issues.

I have followed the "Alternative instructions" on this webpage https://docs.mbed.com/docs/getting-started-mbed-os/en/latest/FirstProjectmbedOS/ with a few changes. I.e. I have set the target to atmel-samr21g18a-gcc 0.1.0 and I have added the cmsis-core-atmel-samcortexm0p-samr21 0.1.0 module manually. However I am seeing a compiler error looking for cmsis.h when I try to build the project.

(yotta workspace) ~/sandbox/example-mbedos-blinky $ yt build
info: generate for target: atmel-samr21g18a-gcc 0.1.0 at /Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_targets/atmel-samr21g18a-gcc
GCC version is: 4.9.3
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/colinfoeparker/sandbox/example-mbedos-blinky/build/atmel-samr21g18a-gcc
[2/59] Building C object ym/cmsis-core/source/CMakeFiles/cmsis-core.dir/...box/example-mbedos-blinky/yotta_modules/cmsis-core/source/cmsis_nvic.c.o
FAILED: /Applications/yotta.app/Contents/Resources/prerequisites/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc   -std=c99 -fno-exceptions -fno-unwind-tables -ffunction-sections -fdata-sections -Wall -Wextra -mcpu=cortex-m0plus -mthumb -Os -g -gdwarf-3 -DNDEBUG -Igenerated/include -I/Users/colinfoeparker/sandbox/example-mbedos-blinky -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/mbed-drivers -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/cmsis-core-atmel-samcortexm0p-samr21 -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/mbed-hal -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/cmsis-core -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/ualloc -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/minar -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/core-util -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/compiler-polyfill -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/dlmalloc -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/minar-platform -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/minar-platform-mbed -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/cmsis-core-atmel-samcortexm0p -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/cmsis-core/cmsis-core -I/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/cmsis-core/source    -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -DMBED_OPERATORS -D__SAMR21G18A__ -D__CORTEX_M0PLUS -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -DMBED_OPERATORS -DTARGET_SAMR21G18A -DI2C_MASTER_CALLBACK_MODE=true -DEXTINT_CALLBACK_MODE=true -DUSART_CALLBACK_MODE=true -DTC_ASYNC=true -include "/Users/colinfoeparker/sandbox/example-mbedos-blinky/build/atmel-samr21g18a-gcc/yotta_config.h" -MMD -MT ym/cmsis-core/source/CMakeFiles/cmsis-core.dir/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/cmsis-core/source/cmsis_nvic.c.o -MF ym/cmsis-core/source/CMakeFiles/cmsis-core.dir/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/cmsis-core/source/cmsis_nvic.c.o.d -o ym/cmsis-core/source/CMakeFiles/cmsis-core.dir/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/cmsis-core/source/cmsis_nvic.c.o -c /Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/cmsis-core/source/cmsis_nvic.c
In file included from /Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/cmsis-core/source/cmsis_nvic.c:31:0:
/Users/colinfoeparker/sandbox/example-mbedos-blinky/yotta_modules/cmsis-core/cmsis-core/cmsis_nvic.h:35:19: fatal error: cmsis.h: No such file or directory
 #include "cmsis.h"
                   ^
compilation terminated.
ninja: build stopped: subcommand failed.
error: command ['ninja'] failed

When I search for cmsis.h in the repository I can find it. (And it looks like it is included in the include path in the build above)

cmsis.h search

(yotta workspace) ~/sandbox/example-mbedos-blinky $ find . -name "cmsis.h"
./yotta_modules/cmsis-core-atmel-samcortexm0p-samr21/source/cmsis.h

Here is a list of all the modules and their versions:

YT Module list

(yotta workspace) ~/sandbox/example-mbedos-blinky $ yt ls -a
example-mbedos-blinky 1.0.0
┣─ mbed-drivers 0.12.0
┃ ┣─ mbed-hal 1.2.2 yotta_modules/mbed-hal
┃ ┃ ┗─ mbed-drivers *
┃ ┣─ cmsis-core 1.1.2 yotta_modules/cmsis-core
┃ ┣─ ualloc 1.0.3 yotta_modules/ualloc
┃ ┃ ┣─ dlmalloc 1.0.0 yotta_modules/dlmalloc
┃ ┃ ┗─ core-util >=1.0.0,<2.0.0
┃ ┣─ minar 1.0.4 yotta_modules/minar
┃ ┃ ┣─ compiler-polyfill >=1.1.0,<2.0.0
┃ ┃ ┣─ minar-platform 1.0.0 yotta_modules/minar-platform
┃ ┃ ┃ ┣─ minar-platform-mbed 1.0.0 yotta_modules/minar-platform-mbed
┃ ┃ ┃ ┃ ┣─ cmsis-core >=1.0.0,<2.0.0
┃ ┃ ┃ ┃ ┣─ mbed-hal >=1.0.0,<2.0.0
┃ ┃ ┃ ┃ ┗─ minar *
┃ ┃ ┃ ┗─ cmsis-core >=1.0.0,<2.0.0
┃ ┃ ┗─ core-util >=1.0.0,<2.0.0
┃ ┣─ core-util 1.2.0 yotta_modules/core-util
┃ ┃ ┣─ ualloc *
┃ ┃ ┣─ cmsis-core >=1.0.0,<2.0.0
┃ ┃ ┗─ mbed-drivers >=0.12.0,<0.13.0
┃ ┗─ compiler-polyfill 1.2.1 yotta_modules/compiler-polyfill
┗─ cmsis-core-atmel-samcortexm0p-samr21 0.1.0
  ┣─ cmsis-core *
  ┗─ cmsis-core-atmel-samcortexm0p 0.1.0 yotta_modules/cmsis-core-atmel-samcortexm0p
    ┣─ cmsis-core *
    ┗─ cmsis-core-atmel-samcortexm0p-samr21 *

If anyone could provide any suggestions about how to fix the yotta build I would appreciate it. (Or identify the build configurations that the mbed online compiler uses by default.)

Thanks!

-Colin

Hi, I've got the same issue, I added cmsis-core-atmel-samcortexm0p-samr21, mbed-hal-atmel-samr21g18a and I linked cmsis-core (dev_atmel branch) and mbed_hal(dev_atmel branch) to my project but still, I get cmsis.h: No such file or directory

@Colin Foe-Parker, have you finally found how to solve this issue?

posted by B Cle 09 Mar 2016

2 Answers

8 years, 3 months ago.

Hi, I've got the same issue, I added cmsis-core-atmel-samcortexm0p-samr21, mbed-hal-atmel-samr21g18a and I linked cmsis-core (dev_atmel branch) and mbed_hal(dev_atmel branch) to my project but still, I get cmsis.h: No such file or directory

@Colin Foe-Parker, have you finally found how to solve this issue?

Accepted Answer

Hi B Cle,

I have not followed up on Martin's suggestion yet.

If you get it to work, please post your methods!

-Colin

posted by Colin Foe-Parker 10 Mar 2016

Hi B Cle,

I was able to get the samr21 target compiling with a series of changes. For simplicity, I am using the default blinky application and the SAMR21 evm dev board. To set your expectations, I just got it compiling so I haven't actually tested the system, but that is a step in the right direction.

As Martin so kindly referenced, we need to update the cmsis-core and mbed-hal modules to link against the atmel target infrastructure.

A pull request has already been filed for the mbed-hal change: https://github.com/ARMmbed/mbed-hal/pull/75

An equivalent change should be made to the cmsis-core. (Just look at the diff's above)

After that, everything built fine for me. There are a fair number of warning associated with "mbed/mbed_assert.h is deprecated" but those are easily fixed.

It is also worth noting that there were some relevant changes pushed to the samr21 repos 4 days ago that seem to fix some of the issues we were having. Please make certain you incorporate them. -Colin

posted by Colin Foe-Parker 14 Mar 2016

Hi Colin,

I told Atmel maintainers to update their work on Mbed updates, they did it and you can now build blinky example without any changes. Thanks for your support

posted by B Cle 15 Mar 2016
8 years, 4 months ago.

Hello,

this question is better asked at mbed.com forum. To answer why it fails: You need to locally link mbed-hal and cmsis-core modules to include atmel target dependencies , as they are not yet published (not on master as well). If the rest of atmel modules are published, it should work.

To link locally, look at yotta docs, basically, clone mbed-hal , look at atmel branch there, do yt link, go to the app, yt link mbed-hal (=same for cmsis-core).