RAK811 Tracker - HowTo



  • Hi,
    now I have a J-Link Interface (Segger) but how to connect to RAK811 Trackerboard?
    Is there a schematic/pin-diagram how to connect?


  • administrators

    0_1516584855263_upload-5010f210-9670-4628-9412-b71c71506475



  • @frml55 you should also check the JLink user guide for the pinouts of your debugger http://www.farnell.com/datasheets/1562851.pdf



  • @rakadmin Does it mean that I must have J-link even to put the Devices EUI, App EUI and App key into the RAK811 Trackerboard?

    I purchased the J-Link through your taobao store but I am not sure if I can use it on my Virtualbox with Windows 7.

    Can I have the environment set up in Ubuntu Linux?

    I just want to setup the Lora Tracker to test in Cayenne MyDevice for now.


  • administrators

    Hello, we currently only provide the Windows environment, if you want to download the program in the Liunx environment, you need to modify the procedures for the gcc compiler environment.



  • @olunia
    Hello,

    Try this, it's work on debian and ubuntu

    https://github.com/oguiter/RAK811_BreakBoard/



  • Hi,
    FYI, i just update the Makefile (some settings were "conflicting")...



  • Hi,
    now I have connected the Segger J-Link adapter like this:
    0_1518348113709_upload-49bf09fc-5cd7-4dce-954a-816ceeff8966

    I've installed CoIDE on my Windows10 PC and "GNU Tools ARM Embedded - 6 2017-q2-update"

    When I try to build I get compiled 56 files without a failure, but when start linking
    the following failure appears:

       [cc] Starting link
       [cc] arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -g2 -nostartfiles -Wl,-Map=RAK811Breakboard_classA.map -Os "-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 -lm -lgcc -lc -lrdimon
       [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.a(lib_a-init.o): In function `__libc_init_array':
       [cc] collect2.exe: error: ld returned 1 exit status
       [cc] init.c:(.text.__libc_init_array+0x20): undefined reference to `_init'
    

    Can anyone help me to build my .bin file?



  • The problem with failed linking is solved.
    CoIDE's configurtion of link file was wrong.
    After I corrected this I've got my bin file, but ...

    • How to get the code in the RAK811 tracker flash?
    • How to connect to TTN?
    • How to connect to Cayenne to test the tracker?


  • Hi,
    in commissioning.h the EUI Values are in "big endian".
    If I build the project with big endian byte format, it doesent works.
    If I build it in little endian it works but activation in TTN doesn't work?!

    What to do?

    Options for code generation (crossStudio) are:

    • Little little endian code and data.
    • Big big endian code and data.
    • BE-8 little endian code and big endian data.


  • It's Chinese New Year so we may have to wait for some answers. I'm facing similar problems.
    When RAK say on there Boxes IoT made easy, what do they mean? it dose not looks that easy to me. Than again I'm not a developer dealing with embedded code. I hoped it would have been a config file you edit and that's it. Can you please continue to share your progress as this would greatly help me and I'm sure many other frustrated owners of the RAK 811 tracker. Thank you


  • administrators

    @frml55 said in RAK811 Tracker - HowTo:

    How to connect to TTN?
    How to connect to Cayenne to test the tracker?

    About this problem ,please see the document:http://docs.rakwireless.com/en/RAK811 TrackerBoard/Software Development/Node Location Solution Kit With TTN V1.0.pdf



  • Can replace RAK811 by RN2903 of (microchip) ????????



  • May be can not, we do not know much about RN2903.



  • Has anyone had any success reading and writing to the eeprom on these boards?



  • This is the Code I have been trying to get going

    void TestEeprom() {
    
            printf("Eeprom test begin");
            
            char buffer[] = "hello out there";
            char buffer2[64];
            memset(buffer2, 0, sizeof(buffer2));
            memcpy(buffer2, "placeholder", sizeof("placeholder"));
    
            uint8_t result = EepromWriteBuffer(0, (uint8_t*)buffer, sizeof(buffer));
            printf("Write result: %d\n", result);
            printf(result == SUCCESS ? "success\n" : "fail\n");
    
            result = EepromReadBuffer(0, (uint8_t*)buffer2, sizeof(buffer2));
            printf("Read result: %d\n", result);
            printf(result == SUCCESS ? "success\n" : "fail\n");
    
            printf("Read: %s\n", buffer2);
    
    }
    

    This code is resulting in both the read and write code reporting as a fail.



  • @laurent.b

    Hi @laurent.b,
    I was seen your post for programing RAK811 on Ubuntu. There, it says: https://github.com/oguiter/RAK811_BreakBoard/#flash-over-usb

    I wonder if it is possible to program the RAK811 through USB with that, or I must buy some J-Link

    With best regards

    Sebastian



  • @barillaro

    How to Edit and Upload the code without a J-Link on Win10 and Atom
    Download Atom.

    https://atom.io/

    Once Download, install and open Atom up.
    Then go to settings > install, search for platformio

    Install the following.
    platformio-ide-terminal
    platformio-ide
    platformio-ide-debugger

    Once done, download and install the comm drivers for the RAK811
    http://docs.rakwireless.com/en/RAK811 TrackerBoard/Tool/CP210x_Windows_Drivers.zip

    Then download the git from OlofAst

    https://github.com/Ebiroll/RAK811_BreakBoard

    open Atom, on the PlatformIO Home Tab, go to Platform

    Search ST STM32, Install

    Then click Reveal

    It will open up a Explorer window, then open folder ststm32/boards

    copy the file from OlofAst’s git, rak811.json to the ststm32/boards folder.

    Then in Atom, click open folder.

    Open the folder RAK811_BreakBoard from OlofAst’s git.

    Then open the Terminal in Atom

    To edit the DevEUI and etc… open the file src\Commissioning.h
    Save, and close the tab.

    Now to Compile.

    In the Terminal window in Atom type: pio run
    if you see SUCCESS, compiling went ok

    Calculating size .pioenvs\rak811\firmware.elf
    text data bss dec hex filename
    53236 1628 5244 60108 eacc .pioenvs\rak811\firmware.elf
    ===[SUCCESS] Took 12.25 seconds

    Now to Upload .bin file to the board
    Change the jumper on the board.

    Connect the usb, go to Device manager and check what is you comm port number for the board.

    Then in the terminal window In Atom, run the following
    stm32flash_src/stm32flash.exe -w .pioenvs/rak811/firmware.bin COM5

    This will upload the .bin file, the result should be

    stm32flash 0.5

    http://stm32flash.sourceforge.net/

    Using Parser : Raw BINARY
    Interface serial_w32: 115200 8E1
    Version : 0x31
    Option 1 : 0x00
    Option 2 : 0x00
    Device ID : 0x0429 (STM32L1xxx6(8/B)A)

    • RAM : 32KiB (4096b reserved by bootloader)
    • Flash : 128KiB (size first sector: 16x256)
    • Option RAM : 32b
    • System RAM : 4KiB
      Write to memory
      Data size: 54868 bytes
      Erasing memory
      Wrote address 0x0800d654 (100.00%) Done.

    You should all be done. Unplug, change the jumper back to original position.
    Power up the board and it should connect to the AP.
    To monitor the board, download Uart Terminal, Connect to the Comm port of the board, at baud rate 115200

    https://sourceforge.net/projects/uartterminal/

    RAK811 BreakBoard soft version: 1.0.2
    Selected LoraWAN 1.0.2 Region: EU868
    OTAA:
    Dev_EUI: XX XX XX XX XX XX XX XX
    AppEui: XX XX XX XX XX XX XX XX
    AppKey: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
    OTAA Join Start…
    OTAA Join Success

    https://www.thethingsnetwork.org/forum/t/rak811-tracker-board/11006/182



  • @qlion
    AMAZING explanation!!!

    I will try this today. Also, I will try on MacOS. (I don't have a windows10 now). I will let you know.

    Thank you very much for all your help.

    With best regards

    Sebastian Barillaro



  • @qlion Your instructions are awesome. Thank you!!!

    I am having a problem uploading the .bin file.

    You stated to "Change the jumper on the board." Change it to what? I originally had the jumpers on SWD_CLK and SWD_TMS. I tried running the code with the jumper in place and after removing it.

    This is what I see everytime:
    0_1523828088934_upload-c2007c4e-f934-4ca2-a21f-c16439665d43 It seems like it is not recognizing serial_32.

    How can I fix this issue. I believe I followed all of your instructions. Thanks


Log in to reply
 

Looks like your connection to RAK Support Center was lost, please wait while we try to reconnect.