OlofAst
(Olof Ast)
February 9, 2018, 3:09pm
82
Checkout this,
Maybe they moved something around or is using a different version , _estack should be defined here,
src/boards/rak811breakboard/cmsis/arm-gcc/stm32l151xb_flash.ld
but maybe you are using linux?
src/boards/RAK811BreakBoard/cmsis/arm-gcc/STM32L151XBA_FLASH.ld
OlofAst
(Olof Ast)
February 9, 2018, 4:12pm
83
Maybe the guys at RAK used a filesystem that is not case sensitive and yours is.
Can you paste the full link command?
You can change classA.coproj from,
LocateLinkFile path="…/…/src/boards/rak811breakboard/cmsis/arm-gcc/stm32l151xb_flash.ld" type=“0”/
To
LocateLinkFile path="…/…/src/boards/RAK811BreakBoard/cmsis/arm-gcc/STM32L151XB_FLASH.ld" type=“0”/
1 Like
OlofAst
(Olof Ast)
February 9, 2018, 4:46pm
84
I also started experimenting with a rak811.json board file to be put in,
~/.platformio/platforms/ststm32/boards
Should be possible, then you can have board = rak811 and framework=cmsis
{
“build”: {
“core”: “stm32”,
“cpu”: “cortex-m3”,
“extra_flags”: “-DSTM32L151xB -DSTM32L151CBU6”,
“hwids”: [
[“0x1EAF”, “0x0003”],
[“0x1EAF”, “0x0004”]
],
“f_cpu”: “32768000L”,
“mcu”: “stm32l151cbu6”,
“variant”: “stm32l151xba”,
“ldscript”: “/home/olas/rak811/RAK811_BreakBoard/src/boards/RAK811BreakBoard/cmsis/arm-gcc/STM32L151XBA_FLASH.ld”
},
“frameworks”: [
“mbed”,
“cmsis”
],
“name”: “Rak811”,
“upload”: {
“maximum_ram_size”: 32768,
“maximum_size”: 128000
},
“url”: “http://www.rakwireless.com/en/download/RAK811/Hardware%20Design ”,
“vendor”: “RAK”
}
OlofAst
(Olof Ast)
February 10, 2018, 9:35am
85
Compiling with platform io,
I have put the complete platformio RAK811 code here,
The blink program is working but timing is way to low and there is no debug output
I use Segger RTT in other projects (but not the rak811 yet) and the devices definitely run without the debug probe connected. not sure why that would make your project not run on normal processor reset?
OlofAst
(Olof Ast)
February 10, 2018, 11:16am
87
The code runs without being connected to the debugger and I can see packets with size 21 on my gateway.
I changed OVER_THE_AIR_ACTIVATION to 0 in Commissiong.h
I will commit a request for a new board RAK811 to platformio.
1 Like
hey frml55, here’s my compiler output in full, if you want to check for any differences…
> GCC HOME: C:\devtools\GNU Tools ARM Embedded\6 2017-q2-update\bin
> compile:
> [mkdir] Created dir: C:\dev\TRA\LoRaWAN\RAK811\FW\coIDE\classA\classa\Debug\bin
> [mkdir] Created dir: C:\dev\TRA\LoRaWAN\RAK811\FW\coIDE\classA\classa\Debug\obj
> [cc] 56 total files to be compiled.
> [cc] arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -g2 -Wall -Os -c "-DUSE_DEBUGGER " "-DUSE_HAL_DRIVER " "-DSTM32L151xB " -DSTM32L151CBU6 -DREGION_AU915 -IC:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\stm32l1xx_hal_driver\inc -IC:\dev\TRA\LoRaWAN\RAK811\FW\src\system\crypto -IC:\dev\TRA\LoRaWAN\RAK811\FW\src\peripherals -IC:\dev\TRA\LoRaWAN\RAK811\FW\src\mac -IC:\dev\TRA\LoRaWAN\RAK811\FW\src -IC:\dev\TRA\LoRaWAN\RAK811\FW\src\mac\region -IC:\dev\TRA\LoRaWAN\RAK811\FW\src\system -IC:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\cmsis -IC:\dev\TRA\LoRaWAN\RAK811\FW\src\radio -IC:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\rak811breakboard\cmsis -IC:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32 -IC:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\rak811breakboard C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_adc_ex.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\adc-board.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\radio\sx1276\sx1276.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\system\delay.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\sysIrqHandlers.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\system\i2c.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\mac\region\Region.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\mac\region\RegionCommon.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_spi.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_i2c.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\system\timer.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\mac\region\RegionEU868.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_spi_ex.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\utilities.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_rtc.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\system\uart.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_gpio.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\cmsis\system_stm32l1xx.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\peripherals\lis3dh.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\gps-board.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\apps\classA\main.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\i2c-board.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\mac\region\RegionAS923.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\board.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_rtc_ex.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_rcc_ex.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\gpio-board.c C:\dev\TRA\LoRaWAN\RAK811\FW\coIDE\classA\components\coocox-master\Retarget_printf\source\printf.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\mac\region\RegionUS915.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\system\gpio.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_pwr.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\rtc-board.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\system\crypto\cmac.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\system\crypto\aes.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\mac\LoRaMac.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_cortex.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\eeprom-board.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\sx1276-board.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\system\fifo.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\uart-board.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_rcc.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\system\adc.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\system\gps.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_uart.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\mac\region\RegionIN865.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\spi-board.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_pwr_ex.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_adc.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\mac\LoRaMacCrypto.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_usart.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\mac\region\RegionKR920.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\mac\region\RegionUS915-Hybrid.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\cmsis\arm-gcc\startup_stm32l151xb.s C:\dev\TRA\LoRaWAN\RAK811\FW\src\mac\region\RegionAU915.c C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\mcu\stm32\STM32L1xx_HAL_Driver\Src\stm32l1xx_hal_dma.c
> [cc] C:\dev\TRA\LoRaWAN\RAK811\FW\src\apps\classA\main.c: In function 'test_gps':
> [cc] C:\dev\TRA\LoRaWAN\RAK811\FW\src\apps\classA\main.c:219:13: warning: variable 'ret' set but not used [-Wunused-but-set-variable]
> [cc] uint8_t ret;
> [cc] ^~~
> [cc] C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\uart-board.c: In function 'e_printchar':
> [cc] C:\dev\TRA\LoRaWAN\RAK811\FW\src\boards\RAK811BreakBoard\uart-board.c:355:1: warning: control reaches end of non-void function [-Wreturn-type]
> [cc] }
> [cc] ^
> [cc] 0 total files to be compiled.
> [cc] Starting link
> [cc] arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -g2 -Wl,-Map=RAK811Breakboard_classA.map -Os -Wl,--gc-sections -LC:/dev/TRA/LoRaWAN/RAK811/FW/src/boards/rak811breakboard/cmsis/arm-gcc -Wl,-TC:/dev/TRA/LoRaWAN/RAK811/FW/src/boards/rak811breakboard/cmsis/arm-gcc/stm32l151xb_flash.ld -g -o RAK811Breakboard_classA.elf ..\obj\sx1276.o ..\obj\printf.o ..\obj\stm32l1xx_hal_rcc.o ..\obj\stm32l1xx_hal_adc.o ..\obj\lis3dh.o ..\obj\gps-board.o ..\obj\startup_stm32l151xb.o ..\obj\sysIrqHandlers.o ..\obj\gpio-board.o ..\obj\stm32l1xx_hal_uart.o ..\obj\uart-board.o ..\obj\gps.o ..\obj\stm32l1xx_hal_pwr.o ..\obj\Region.o ..\obj\stm32l1xx_hal_spi.o ..\obj\LoRaMac.o ..\obj\fifo.o ..\obj\RegionKR920.o ..\obj\timer.o ..\obj\stm32l1xx_hal_gpio.o ..\obj\uart.o ..\obj\rtc-board.o ..\obj\stm32l1xx_hal_cortex.o ..\obj\utilities.o ..\obj\main.o ..\obj\stm32l1xx_hal_rtc.o ..\obj\cmac.o ..\obj\adc-board.o ..\obj\aes.o ..\obj\system_stm32l1xx.o ..\obj\sx1276-board.o ..\obj\RegionEU868.o ..\obj\RegionUS915-Hybrid.o ..\obj\RegionAS923.o ..\obj\RegionCommon.o ..\obj\LoRaMacCrypto.o ..\obj\stm32l1xx_hal_i2c.o ..\obj\RegionIN865.o ..\obj\stm32l1xx_hal.o ..\obj\delay.o ..\obj\RegionAU915.o ..\obj\spi-board.o ..\obj\stm32l1xx_hal_rcc_ex.o ..\obj\stm32l1xx_hal_adc_ex.o ..\obj\eeprom-board.o ..\obj\stm32l1xx_hal_dma.o ..\obj\board.o ..\obj\i2c-board.o ..\obj\stm32l1xx_hal_spi_ex.o ..\obj\stm32l1xx_hal_pwr_ex.o ..\obj\gpio.o ..\obj\adc.o ..\obj\RegionUS915.o ..\obj\i2c.o ..\obj\stm32l1xx_hal_rtc_ex.o ..\obj\stm32l1xx_hal_usart.o -lrdimon -lm -lc
> Program Size:
> text data bss dec hex filename
> 78592 1580 7444 87616 15640 RAK811Breakboard_classA.elf
>
> BUILD SUCCESSFUL
> Total time: 43 seconds
>
jezd
(JD)
February 10, 2018, 12:33pm
89
will have a go later, where do the board json files live?
BoRRoZ
February 10, 2018, 12:36pm
90
I just sit back and see your guys working really hard to crack this board … great work !
2 Likes
frml55
(Frml55)
February 10, 2018, 1:05pm
91
@julian-1 : Thank you. I will check the differences this afternoon. It‘s really hard work in comparison to Arduino-workd
1 Like
OlofAst
(Olof Ast)
February 10, 2018, 1:45pm
92
On linux they are stored here,
.platformio/platforms/ststm32/boards/
Should be something similar on wondows.
I managed to get packet through to my app on the things networks so it seems to be working.
May RAK811 arrived. What’s the easiest way to get in online on ttnmapper.org ?
jezd
(JD)
February 10, 2018, 11:09pm
94
Huge thanks to @OlofAst on this, all working on Windows 10, Visual Source Code, Platformio addon, used your github code (see post above) as it is for testing.
Dropped in the new RAK board json file
Created new RAK811 board project
Copied Lib, Src and platformio.ini files across to the new project
Changed Commissioning.h device settings
Compiled, few warnings but did ok, BIN file created
Burn device with STM flash loader demo gui, had to use (STM32L1_Cat2-128K) to get it to work?
Work well with OTA, sending movement, battery and temp data via Cayenne (pre coded for this)
Interesting that it joins on SF7 here and then falls back to SF12, will see how ADR behaves re this
Thanks, I would never have got this far on my own!!
Lots to do now in terms of testing, lowpower, changing etc - not got GPS on my board (ordered two tracker boards from RAK).
Jez
2 Likes
frml55
(Frml55)
February 11, 2018, 5:55pm
95
Sorry, here is the full link command:
[cc] Starting link
[cc] arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -g2 -Wl,-Map=RAK811Breakboard_classA.map -Os --specs=nano.specs “-LC:/Eigene Dateien/0_Familienmitglieder/Maze/IOT Allgemein/RAK811 Tracker/coIDE/classA” “-Wl,-TC:/Eigene Dateien/0_Familienmitglieder/Maze/IOT Allgemein/RAK811 Tracker/coIDE/classA/link.ld” -g -o RAK811Breakboard_classA.elf …\obj\sx1276.o …\obj\printf.o …\obj\stm32l1xx_hal_rcc.o …\obj\stm32l1xx_hal_adc.o …\obj\lis3dh.o …\obj\gps-board.o …\obj\startup_stm32l151xb.o …\obj\sysIrqHandlers.o …\obj\gpio-board.o …\obj\stm32l1xx_hal_uart.o …\obj\uart-board.o …\obj\gps.o …\obj\stm32l1xx_hal_pwr.o …\obj\Region.o …\obj\stm32l1xx_hal_spi.o …\obj\LoRaMac.o …\obj\fifo.o …\obj\RegionKR920.o …\obj\timer.o …\obj\stm32l1xx_hal_gpio.o …\obj\uart.o …\obj\rtc-board.o …\obj\stm32l1xx_hal_cortex.o …\obj\utilities.o …\obj\main.o …\obj\stm32l1xx_hal_rtc.o …\obj\cmac.o …\obj\adc-board.o …\obj\aes.o …\obj\system_stm32l1xx.o …\obj\sx1276-board.o …\obj\RegionEU868.o …\obj\RegionUS915-Hybrid.o …\obj\RegionAS923.o …\obj\RegionCommon.o …\obj\LoRaMacCrypto.o …\obj\stm32l1xx_hal_i2c.o …\obj\RegionIN865.o …\obj\stm32l1xx_hal.o …\obj\delay.o …\obj\RegionAU915.o …\obj\spi-board.o …\obj\stm32l1xx_hal_rcc_ex.o …\obj\stm32l1xx_hal_adc_ex.o …\obj\eeprom-board.o …\obj\stm32l1xx_hal_dma.o …\obj\board.o …\obj\i2c-board.o …\obj\stm32l1xx_hal_spi_ex.o …\obj\stm32l1xx_hal_pwr_ex.o …\obj\gpio.o …\obj\adc.o …\obj\RegionUS915.o …\obj\i2c.o …\obj\stm32l1xx_hal_rtc_ex.o …\obj\stm32l1xx_hal_usart.o -lrdimon -lm -lc
[cc] …\obj\startup_stm32l151xb.o:(.isr_vector+0x0): undefined reference to _estack' [cc] c:/program files (x86)/gnu tools arm embedded/6 2017-q2-update/bin/../lib/gcc/arm-none-eabi/6.3.1/../../../../arm-none-eabi/lib/thumb/v7-m\libc_nano.a(lib_a-exit.o): In function
exit’:
[cc] exit.c:(.text.exit+0x1a): undefined reference to `_exit’
[cc] collect2.exe: error: ld returned 1 exit status
jezd
(JD)
February 11, 2018, 6:40pm
96
anyone seeing ADR working on this board?
OlofAst
(Olof Ast)
February 11, 2018, 8:48pm
97
Hello frml55
For some reason the wrong link script is used,
“-LC:/Eigene Dateien/0_Familienmitglieder/Maze/IOT Allgemein/RAK811 Tracker/coIDE/classA” “-Wl,-TC:/Eigene Dateien/0_Familienmitglieder/Maze/IOT Allgemein/RAK811 Tracker/coIDE/classA/link.ld”
Should have been this,
-TC:/dev/TRA/LoRaWAN/RAK811/FW/src/boards/rak811breakboard/cmsis/arm-gcc/stm32l151xb_flash.ld
Double check the LocateLinkFile path in the ClassA.coproj file
frml55
(Frml55)
February 11, 2018, 9:02pm
98
@OlofAst : Thanks.
I had no idea, but searched for *.ld files and found these:
Then I renamed “STM32L151XBA”_FLASH.ld to “link.ld” and copied it to the directory of link.ld
Full sucess.
Then I found in CoIDE configuration “Scatter file” and placed the right Linker file there:
And it worked again
Now last question: Is “STM32L151XBA_FLASH” or “STM32L151XB_FLASH” the right one?
frml55
(Frml55)
February 11, 2018, 9:58pm
99
Both link files are working.
Now I have my “RAK811Breakboard_classA.elf” and “RAK811Breakboard_classA.bin”
But what to do next to connect the board to TTN and Cayenne?
OlofAst
(Olof Ast)
February 11, 2018, 11:24pm
100
To connect to the network you should edit the file Commisioning.h
Is “STM32L151XBA_FLASH” or “STM32L151XB_FLASH” the right one?
One is for the 16KB verssion of the board, If both works you probably have a 32KB version and should use XBA version of the ld file as it should allow you to use more RAM.
OlofAst
(Olof Ast)
February 12, 2018, 1:31am
101
Hello again,I also got printf to work.
I moved the printf.c source file from lib/Retarget_printf/src/ to src
Also added -fno-builtin flag to compilation flags but not sure if that was important.
I got Move detected INT1 whenever i move the board.
Move Detected INT1 src:0x60
Move Detected INT1 src:0x60
[Debug]: tempr: 35 Bat: 3991mv
[Debug]: ACC X:FF00 Y:0000 Z:FF00
GpsGetLatestGpsPositionDouble ret = 0
[Debug]: tempr: 35 Bat: 3991mv
I dont have a gps on my board.