Month: October 2015

Adding kernel command line parameters when boot with GRUB2

You can add kernel boot parameter editing the file /etc/default/grub:

$ sudo vi /etc/default/grub

Just add it to variable:

GRUB_CMDLINE_LINUX_DEFAULT

Then just update GRUB:

$ sudo update-grub

Source: http://askubuntu.com/questions/19486/how-do-i-add-a-kernel-boot-parameter

Advertisements

Fixing gnu arm toolchain issues Ubuntu vs Terry Guo

I was using the default “gcc-arm-none-eabi” package from Ubuntu 14.04 but was receiving this error message when trying to compile “nrf51-sdk”:

arm-none-eabi-gcc: error: nano.specs: No such file or directory
make: *** [blink.elf] Error 1

Searching about the issue I discovered this issue is related to Ubuntu’s gcc-arm-none-eabi package, more info see:

https://bugs.launchpad.net/gcc-arm-embedded/+bug/1309060

Then I followed the steps suggested:

$ sudo apt-get remove binutils-arm-none-eabi gcc-arm-none-eabi

$ sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded

$ sudo apt-get update

$ sudo apt-get install gcc-arm-none-eabi

Now compilation goes fine!

Trying the compile nrf51-sdk

These are the steps I’m executing to try to compile the nrf51-sdk on Linux:

$ git clone https://github.com/relayr/nrf51-sdk.git

$ cd nrf51-sdk

$ mv build.mk Makefile

$ cd nordic/

$ unzip ../../SDK/V8/nRF51_SDK_8.1.0_b6ed55f.zip (download from https://developer.nordicsemi.com/nRF51_SDK/)

$ cd ..

$ vi nordic/components/drivers_nrf/pstorage/pstorage.h

replace the include to:
#include "config/pstorage_platform.h"

$ make
arm-none-eabi-gcc -MM -I/comum/workspace/nRF51822/nrf51-sdk/relayr/src -I/comum/workspace/nRF51822/nrf51-sdk/relayr/include -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/hal -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/softdevice/s110/headers -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/pstorage/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/ble/common -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/libraries/util -mcpu=cortex-m0 -mfloat-abi=soft -mthumb -mabi=aapcs -ffunction-sections -fdata-sections -fno-builtin -fplan9-extensions -std=gnu11 -Wall -Wno-main -Werror -g -DNRF51 -DNRF51822_QFAA_CA -DBLE_STACK_SUPPORT_REQD -DSOFTDEVICE_PRESENT -D__HEAP_SIZE=0 -MT pstorage.d -MT pstorage.o -MP -MF pstorage.d /comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/pstorage/pstorage.c
arm-none-eabi-gcc -MM -I/comum/workspace/nRF51822/nrf51-sdk/relayr/src -I/comum/workspace/nRF51822/nrf51-sdk/relayr/include -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/hal -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/softdevice/s110/headers -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/pstorage/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/ble/common -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/libraries/util -mcpu=cortex-m0 -mfloat-abi=soft -mthumb -mabi=aapcs -ffunction-sections -fdata-sections -fno-builtin -fplan9-extensions -std=gnu11 -Wall -Wno-main -Werror -g -DNRF51 -DNRF51822_QFAA_CA -DBLE_STACK_SUPPORT_REQD -DSOFTDEVICE_PRESENT -D__HEAP_SIZE=0 -MT system_nrf51.d -MT system_nrf51.o -MP -MF system_nrf51.d /comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/system_nrf51.c
arm-none-eabi-gcc -MM -I/comum/workspace/nRF51822/nrf51-sdk/relayr/src -I/comum/workspace/nRF51822/nrf51-sdk/relayr/include -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/hal -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/softdevice/s110/headers -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/pstorage/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/ble/common -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/libraries/util -mcpu=cortex-m0 -mfloat-abi=soft -mthumb -mabi=aapcs -ffunction-sections -fdata-sections -fno-builtin -fplan9-extensions -std=gnu11 -Wall -Wno-main -Werror -g -DNRF51 -DNRF51822_QFAA_CA -DBLE_STACK_SUPPORT_REQD -DSOFTDEVICE_PRESENT -D__HEAP_SIZE=0 -MT rtc.d -MT rtc.o -MP -MF rtc.d /comum/workspace/nRF51822/nrf51-sdk/relayr/src/rtc.c
arm-none-eabi-gcc -MM -I/comum/workspace/nRF51822/nrf51-sdk/relayr/src -I/comum/workspace/nRF51822/nrf51-sdk/relayr/include -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/hal -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/softdevice/s110/headers -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/pstorage/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/ble/common -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/libraries/util -mcpu=cortex-m0 -mfloat-abi=soft -mthumb -mabi=aapcs -ffunction-sections -fdata-sections -fno-builtin -fplan9-extensions -std=gnu11 -Wall -Wno-main -Werror -g -DNRF51 -DNRF51822_QFAA_CA -DBLE_STACK_SUPPORT_REQD -DSOFTDEVICE_PRESENT -D__HEAP_SIZE=0 -MT batt_serv.d -MT batt_serv.o -MP -MF batt_serv.d /comum/workspace/nRF51822/nrf51-sdk/relayr/src/batt_serv.c
arm-none-eabi-gcc -MM -I/comum/workspace/nRF51822/nrf51-sdk/relayr/src -I/comum/workspace/nRF51822/nrf51-sdk/relayr/include -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/hal -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/softdevice/s110/headers -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/pstorage/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/ble/common -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/libraries/util -mcpu=cortex-m0 -mfloat-abi=soft -mthumb -mabi=aapcs -ffunction-sections -fdata-sections -fno-builtin -fplan9-extensions -std=gnu11 -Wall -Wno-main -Werror -g -DNRF51 -DNRF51822_QFAA_CA -DBLE_STACK_SUPPORT_REQD -DSOFTDEVICE_PRESENT -D__HEAP_SIZE=0 -MT util.d -MT util.o -MP -MF util.d /comum/workspace/nRF51822/nrf51-sdk/relayr/src/util.c
arm-none-eabi-gcc -MM -I/comum/workspace/nRF51822/nrf51-sdk/relayr/src -I/comum/workspace/nRF51822/nrf51-sdk/relayr/include -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/hal -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/softdevice/s110/headers -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/pstorage/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/ble/common -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/libraries/util -mcpu=cortex-m0 -mfloat-abi=soft -mthumb -mabi=aapcs -ffunction-sections -fdata-sections -fno-builtin -fplan9-extensions -std=gnu11 -Wall -Wno-main -Werror -g -DNRF51 -DNRF51822_QFAA_CA -DBLE_STACK_SUPPORT_REQD -DSOFTDEVICE_PRESENT -D__HEAP_SIZE=0 -MT simble.d -MT simble.o -MP -MF simble.d /comum/workspace/nRF51822/nrf51-sdk/relayr/src/simble.c
arm-none-eabi-gcc -MM -I/comum/workspace/nRF51822/nrf51-sdk/relayr/src -I/comum/workspace/nRF51822/nrf51-sdk/relayr/include -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/hal -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/softdevice/s110/headers -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/pstorage/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/ble/common -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/libraries/util -mcpu=cortex-m0 -mfloat-abi=soft -mthumb -mabi=aapcs -ffunction-sections -fdata-sections -fno-builtin -fplan9-extensions -std=gnu11 -Wall -Wno-main -Werror -g -DNRF51 -DNRF51822_QFAA_CA -DBLE_STACK_SUPPORT_REQD -DSOFTDEVICE_PRESENT -D__HEAP_SIZE=0 -MT onboard-led.d -MT onboard-led.o -MP -MF onboard-led.d /comum/workspace/nRF51822/nrf51-sdk/relayr/src/onboard-led.c
arm-none-eabi-gcc -MM -I/comum/workspace/nRF51822/nrf51-sdk/relayr/src -I/comum/workspace/nRF51822/nrf51-sdk/relayr/include -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/hal -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/softdevice/s110/headers -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/pstorage/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/ble/common -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/libraries/util -mcpu=cortex-m0 -mfloat-abi=soft -mthumb -mabi=aapcs -ffunction-sections -fdata-sections -fno-builtin -fplan9-extensions -std=gnu11 -Wall -Wno-main -Werror -g -DNRF51 -DNRF51822_QFAA_CA -DBLE_STACK_SUPPORT_REQD -DSOFTDEVICE_PRESENT -D__HEAP_SIZE=0 -MT indicator.d -MT indicator.o -MP -MF indicator.d /comum/workspace/nRF51822/nrf51-sdk/relayr/src/indicator.c
arm-none-eabi-gcc -MM -I/comum/workspace/nRF51822/nrf51-sdk/relayr/src -I/comum/workspace/nRF51822/nrf51-sdk/relayr/include -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/hal -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/softdevice/s110/headers -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/drivers_nrf/pstorage/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/toolchain/gcc/ -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/device -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/ble/common -I/comum/workspace/nRF51822/nrf51-sdk/nordic/components/libraries/util -mcpu=cortex-m0 -mfloat-abi=soft -mthumb -mabi=aapcs -ffunction-sections -fdata-sections -fno-builtin -fplan9-extensions -std=gnu11 -Wall -Wno-main -Werror -g -DNRF51 -DNRF51822_QFAA_CA -DBLE_STACK_SUPPORT_REQD -DSOFTDEVICE_PRESENT -D__HEAP_SIZE=0 -MT i2c.d -MT i2c.o -MP -MF i2c.d /comum/workspace/nRF51822/nrf51-sdk/relayr/src/i2c.c
make: *** No rule to make target `.hex', needed by `all'.  Stop.

Using JLinkExe to flash a new firmware into STM32F407

These are the commands I use to flash a nuttx.bin firmware in the STM32F407 microcontroller:

$ JLinkExe -if SWD
SEGGER J-Link Commander V4.98e ('?' for help)
Compiled May  5 2015 11:49:39
DLL version V4.98e, compiled May  5 2015 11:49:35
Firmware: J-Link ARM V8 compiled Nov 28 2014 13:44:46
Hardware: V8.00
S/N: 268006167 
OEM: SEGGER-EDU 
Feature(s): FlashBP, GDB 
VTarget = 0.200V
J-Link>exit

$ sudo JLinkExe 
SEGGER J-Link Commander V4.98e ('?' for help)
Compiled May  5 2015 11:49:39
DLL version V4.98e, compiled May  5 2015 11:49:35
Firmware: J-Link ARM V8 compiled Nov 28 2014 13:44:46
Hardware: V8.00
S/N: 268006167 
OEM: SEGGER-EDU 
Feature(s): FlashBP, GDB 
VTarget = 3.300V
Info: TotalIRLen = 9, IRPrint = 0x0011
Info: Found Cortex-M4 r0p1, Little endian.
Info: FPUnit: 6 code (BP) slots and 2 literal slots
Info: CoreSight components:
Info: ROMTbl 0 @ E00FF000
Info: ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB00C SCS
Info: ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWT
Info: ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPB
Info: ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 003BB001 ITM
Info: ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 000BB9A1 TPIU
Info: ROMTbl 0 [5]: FFF42000, CID: B105900D, PID: 000BB925 ETM
Found 2 JTAG devices, Total IRLen = 9:
 #0 Id: 0x4BA00477, IRLen: 04, IRPrint: 0x1, CoreSight JTAG-DP (ARM)
 #1 Id: 0x06413041, IRLen: 05, IRPrint: 0x1, STM32 Boundary Scan
Cortex-M4 identified.
Target interface speed: 100 kHz

J-Link> device stm32f407ve
Info: Device "STM32F407VE" selected.
Reconnecting to target...
Info: TotalIRLen = 9, IRPrint = 0x0011
Info: TotalIRLen = 9, IRPrint = 0x0011
Info: Found Cortex-M4 r0p1, Little endian.
Info: FPUnit: 6 code (BP) slots and 2 literal slots
Info: CoreSight components:
Info: ROMTbl 0 @ E00FF000
Info: ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB00C SCS
Info: ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWT
Info: ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPB
Info: ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 003BB001 ITM
Info: ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 000BB9A1 TPIU
Info: ROMTbl 0 [5]: FFF42000, CID: B105900D, PID: 000BB925 ETM

J-Link> loadbin ./nuttx.bin 0
Halting CPU for downloading file.
Downloading file [./nuttx.bin]...Info: J-Link: Flash download: Flash programming performed for 1 range (65536 bytes)
Info: J-Link: Flash download: Total time needed: 9.917s (Prepare: 0.678s, Compare: 0.016s, Erase: 1.447s, Program: 7.687s, Verify: 0.006s, Restore: 0.081s)
O.K.
J-Link>