Msprf24 library

Hello,
I don’t know whether this is me doing something wrong (its 1st time Im trying to use some lib here…so far - with no success yet), or port of this lib is broken maybe… anyway I need advise.
Here is my result and environment:

PS C:\PlatformIO\msp430_kwiatek> pio run
[07/18/16 21:22:11] Processing LaunchPad_msp430g2553 (platform: timsp430, board_mcu: msp430g2553, board_f_cpu: 16000000L)

msp430-gcc -o .pioenvs\LaunchPad_msp430g2553\nRF24_ID40\TESTPROGS\g2231\pwrup-plus-prx.o -c -g -Os -ffunction-sections -fdata-sections -mmcu=msp430g2553 -DF_CPU=16000000L -DPLATFORMIO=021101 -I.pioenvs\LaunchPad_
msp430g2553\nRF24_ID40 .pioenvs\LaunchPad_msp430g2553\nRF24_ID40\TESTPROGS\g2231\pwrup-plus-prx.c
msp430-gcc -o .pioenvs\LaunchPad_msp430g2553\nRF24_ID40\TESTPROGS\g2231\test-basic-pwrup.o -c -g -Os -ffunction-sections -fdata-sections -mmcu=msp430g2553 -DF_CPU=16000000L -DPLATFORMIO=021101 -I.pioenvs\LaunchPa
d_msp430g2553\nRF24_ID40 .pioenvs\LaunchPad_msp430g2553\nRF24_ID40\TESTPROGS\g2231\test-basic-pwrup.c
.pioenvs\LaunchPad_msp430g2553\nRF24_ID40\TESTPROGS\g2231\pwrup-plus-prx.c: In function ‘main’:
.pioenvs\LaunchPad_msp430g2553\nRF24_ID40\TESTPROGS\g2231\pwrup-plus-prx.c:50:11: error: ‘data’ undeclared (first use in this function)
.pioenvs\LaunchPad_msp430g2553\nRF24_ID40\TESTPROGS\g2231\pwrup-plus-prx.c:50:11: note: each undeclared identifier is reported only once for each function it appears in
.pioenvs\LaunchPad_msp430g2553\nRF24_ID40\TESTPROGS\g2231\test-basic-pwrup.c: In function ‘test_msprf24_init’:
.pioenvs\LaunchPad_msp430g2553\nRF24_ID40\TESTPROGS\g2231\test-basic-pwrup.c:68:2: error: ‘CSN_DIS’ undeclared (first use in this function)
.pioenvs\LaunchPad_msp430g2553\nRF24_ID40\TESTPROGS\g2231\test-basic-pwrup.c:68:2: note: each undeclared identifier is reported only once for each function it appears in

.pioenvs\LaunchPad_msp430g2553\nRF24_ID40\TESTPROGS\g2231\test-basic-pwrup.c:77:2: error: ‘CE_DIS’ undeclared (first use in this function)
scons: *** [.pioenvs\LaunchPad_msp430g2553\nRF24_ID40\TESTPROGS\g2231\pwrup-plus-prx.o] Error 1
scons: *** [.pioenvs\LaunchPad_msp430g2553\nRF24_ID40\TESTPROGS\g2231\test-basic-pwrup.o] Error 1
=========================================================================================== [ ERROR ] Took 0.77 seconds ===========================================================================================
PS C:\PlatformIO\msp430_kwiatek> dir

Directory: C:\PlatformIO\msp430_kwiatek

Mode LastWriteTime Length Name


d---- 2016-07-18 21:22 .pioenvs
d---- 2016-07-05 00:45 lib
d---- 2016-07-18 21:10 src
-a— 2016-07-18 21:13 818 .clang_complete
-a— 2016-07-18 21:13 1196 .gcc-flags.json
-a— 2016-07-18 21:13 42 .gitignore
-a— 2016-07-04 17:59 1587 .travis.yml
-a— 2016-07-18 21:14 805 platformio.ini

PS C:\PlatformIO\msp430_kwiatek> dir src/

Directory: C:\PlatformIO\msp430_kwiatek\src

Mode LastWriteTime Length Name


-a— 2016-07-17 03:11 2649 main.cpp
-a— 2016-07-17 02:51 2542 nrf_userconfig.h

PS C:\PlatformIO\msp430_kwiatek> cat .\platformio.ini | grep ^[^#]

[env:LaunchPad_msp430g2553]
platform = timsp430
board_mcu = msp430g2553
board_f_cpu = 16000000L

PS C:\PlatformIO\msp430_kwiatek> cat .\src\main.cpp | grep include
#include <msp430.h>
#include <string.h>
#include “msprf24.h”
#include “nrf_userconfig.h”

PS C:\PlatformIO\msp430_kwiatek> pio lib list
[ ID ] Name Compatibility “Authors”: Description

[ 40 ] nRF24 timsp430 “Eric”: The nRF24L01 is a low-cost 2.4GHz ISM transceiver module. It supports a number of channel frequencies in the 2.4GHz band and a range of data rates
[ 124 ] RadioHead arduino, energia, atmelavr, atmelsam, timsp430, titiva, teensy, freescalekinetis, ststm32, nordicnrf51, nxplpc, espressif, siliconlabsefm32, linux_arm, native “Mike McCauley”: The RadioHe
ad Packet Radio library which provides a complete object-oriented library for sending and receiving packetized messages via RF22/24/26/27/69, Si4460/4461/4463/4464, nRF24/nRF905, SX1276/77/78, RFM95/96/97/98 and
etc.
[ 251 ] VirtualWire arduino, atmelavr, atmelsam, timsp430, titiva, teensy, freescalekinetis, ststm32, nordicnrf51, nxplpc, espressif, siliconlabsefm32, linux_arm, native “Mike McCauley”: It provides a simple
message passing protocol for a range of inexpensive transmitter and receiver modules
[ 576 ] LiquidCrystal_I2C arduino, atmelavr “marcoschwartz”: A library for DFRobot I2C LCD displays
PS C:\PlatformIO\msp430_kwiatek> pio lib list | grep 40
[ 40 ] nRF24 timsp430 “Eric”: The nRF24L01 is a low-cost 2.4GHz ISM transceiver module. It supports a number of channel frequencies in the 2.4GHz band and a range of data rates
PS C:\PlatformIO\msp430_kwiatek> pio lib list | grep nRF24
[ 40 ] nRF24 timsp430 “Eric”: The nRF24L01 is a low-cost 2.4GHz ISM transceiver module. It supports a number of channel frequencies in the 2.4GHz band and a range of data rates
[ 124 ] RadioHead arduino, energia, atmelavr, atmelsam, timsp430, titiva, teensy, freescalekinetis, ststm32, nordicnrf51, nxplpc, espressif, siliconlabsefm32, linux_arm, native “Mike McCauley”: The RadioHe
ad Packet Radio library which provides a complete object-oriented library for sending and receiving packetized messages via RF22/24/26/27/69, Si4460/4461/4463/4464, nRF24/nRF905, SX1276/77/78, RFM95/96/97/98 and
etc.

Why it is referring to something with g2231 , I setup my MCU to g2553 ?
Did I setup it correctly ? With library I simply did “pio lib install 40”, hopping it will do all the needed…

hm, I found in ~/.platformio/lib/nRF24_ID40
TESTPROGS directory , with examples I suppose ? I removed this, but still it is not ok… I’m confused… I see it have needed .o files builded :

C:\PlatformIO\msp430_kwiatek.pioenvs\LaunchPad_msp430g2553\nRF24_ID40>dir
Volume in drive C has no label.
Volume Serial Number is 8E1E-F1E4

Directory of C:\PlatformIO\msp430_kwiatek.pioenvs\LaunchPad_msp430g2553\nRF24_
ID40

2016-07-18 21:41 .
2016-07-18 21:41 …
2015-12-06 14:13 20 680 msp430_spi.c
2015-12-06 14:13 1 168 msp430_spi.h
2016-07-18 21:41 6 528 msp430_spi.o
2015-12-06 14:13 24 363 msprf24.c
2015-12-06 14:13 8 116 msprf24.h
2016-07-18 21:41 32 696 msprf24.o
2015-12-06 14:13 4 121 nRF24L01.h
2015-12-06 14:13 2 252 nrf_userconfig.h
2016-07-18 21:41 Pkt_CPP
8 File(s) 99 924 bytes
3 Dir(s) 3 306 913 792 bytes free

You are going to use “native programming” with a library that depends on Energia framework.

The correct platformio.ini:

[env:LaunchPad_msp430g2553]
platform = timsp430
framework = energia
board = lpmsp430g2553

See more examples platform-timsp430/examples at develop · platformio/platform-timsp430 · GitHub

this lib is marked with Compatibility = timsp430 (only) , energia is not mentioned. So I tought it will be possible to not use energia with it… I dont want to use energia.

pio lib list
[ ID ] Name Compatibility “Authors”: Description


[ 40 ] nRF24 timsp430 “Eric”: The nRF24L01 is a low-cost 2.4GHz ISM transceiver module. It supports a number of channel frequencies in the 2.4GHz band and a range of data rates

Please sorry, you are right. This library doesn’t depend on Energia:

Please remove TESTPROGS folder from ~/.platformio/lib/nRF24_ID40.

Did it help you?

P.S: Also, I’m not sure that Pkt_CPP is also required.

Thanks Ivan, yes - I tried already to remove TESTPROGS, please see my 2nd post here. It didnt helped :frowning:

  1. I’ve just updated the library.json manifest for this library. PlatformIO 3.0 has very powerful library build system and can handle additional extra flags and options. See
    Don't build examples by ivankravets · Pull Request #20 · spirilis/msprf24 · GitHub

  2. I successful built a few examples. Please rename TESTPROGS to examples or remove it from the library source code. Then choose of the examples from that folder and use this platformio.ini

[env:lpmsp430g2553]
platform = timsp430
board = lpmsp430g2553

My project structure

├── lib
│   ├── nRF24_c52fb7bca5_40
│   │   ├── COPYRIGHT
│   │   ├── Pkt_CPP
│   │   ├── README.md
│   │   ├── examples
│   │   ├── library.json
│   │   ├── msp430_spi.c
│   │   ├── msp430_spi.h
│   │   ├── msprf24.c
│   │   ├── msprf24.h
│   │   ├── nRF24L01.h
│   │   └── nrf_userconfig.h
│   └── readme.txt
├── platformio.ini
└── src
    └── ike-uscia-rx.c

PlatformIO 3.0 will automatically build this library without any additional actions.

Tnx Ivan, great support :wink:
I will try it as soon as I get to back to home.
Will it work with platformio 2.x ? Or have I update to 3.0 ? How to upgrade it ? I recently did ‘pio upgrade/update’ and it was on the latest version , which was 2.xx-something.
Im not sure how to force update to 3.x ?

Hi!
Here CLion Project Libs is a post from ivan how to test 3.0 in an virtual environment.

Maybe it helps.

Robert

If you manually rename folder to examples, then it will work with PlatformIO 2.0 too

Thanks guys ! Its working correctly now.
However I had to reinitialize this project from scratch, I have two setups of platformio, on laptop and desktop PC, on one of them it was still not working, for unknown reason. I recreated it as a new project, by copying contents of main.c

I have other questions yet, but I think better would be to open new threads, will be more visible and understandable for other users, if somebody else will have similar problems/questions.

Could you explain in details?

Sure, fortunately I still have this project yet.
So, even after remove/rename TESTPROGS directory it was not building (result below).

but as far as I can see - there is msp43_spi.o file, in .pioenv, with needed symbols.
What I did, was only to create new project and copy content of main.c
Probably there are some leftovers somewhere…
Its not important for me anymore, all is ok now, I can continue working :wink:

platformio run
[07/20/16 14:06:32] Processing lpmsp430g2553 (platform: timsp430, board: lpmsp430g2553)

msp430-gcc -o .pioenvs\lpmsp430g2553\firmware.elf -Os -mmcu=msp430g2553 -Wl,-gc-sections,-u,main .pioenvs\lpmsp430g2553\src\main.o -LC:\users\voyo.platformio\packages\ldscripts -L.pioenvs\lpmsp430g2553 -Wl,–start-g
roup -lm .pioenvs\lpmsp430g2553\libnRF24_ID40.a -Wl,–end-group
.pioenvs\lpmsp430g2553\src\main.o: In function main': C:\PlatformIO\msp430_kwiatek/src/main.cpp:56: undefined reference tomsprf24_init()‘
C:\PlatformIO\msp430_kwiatek/src/main.cpp:57: undefined reference to `msprf24_set_pipe_packetsize(unsigned char, unsigned char)’

C:\PlatformIO\msp430_kwiatek/src/main.cpp:58: undefined reference to msprf24_open_pipe(unsigned char, unsigned char)' C:\PlatformIO\msp430_kwiatek/src/main.cpp:63: undefined reference tomsprf24_standby()'
C:\PlatformIO\msp430_kwiatek/src/main.cpp:64: undefined reference to msprf24_current_state()' C:\PlatformIO\msp430_kwiatek/src/main.cpp:69: undefined reference tow_tx_addr(unsigned char*)'
C:\PlatformIO\msp430_kwiatek/src/main.cpp:70: undefined reference to w_rx_addr(unsigned char, unsigned char*)' C:\PlatformIO\msp430_kwiatek/src/main.cpp:76: undefined reference tomsprf24_get_irq_reason()'
C:\PlatformIO\msp430_kwiatek/src/main.cpp:77: undefined reference to msprf24_irq_clear(unsigned char)' C:\PlatformIO\msp430_kwiatek/src/main.cpp:78: undefined reference tomsprf24_get_last_retransmits()'
C:\PlatformIO\msp430_kwiatek/src/main.cpp:84: undefined reference to w_tx_payload(unsigned char, unsigned char*)' C:\PlatformIO\msp430_kwiatek/src/main.cpp:85: undefined reference tomsprf24_activate_tx()'
collect2: ld returned 1 exit status
scons: *** [.pioenvs\lpmsp430g2553\firmware.elf] Error 1
[ ERROR ] Took 0.55 seconds
Unable to execute: platformio

  1. Remove .pioenvs directory from the project
  2. Build project and share FULL log on http://pastebin.com

OKi…
here is output, I hope its enough for you to diagnose ?
http://pastebin.com/NnNaNeLH

and one more minor problem - platformio.ini file is fragile to whitespaces , I added by accident on the begining of lines and it crashed.

  1. Sorry, I don’t understand what do you do. Please provide me FULL BUILD log, not only “linker output”.
  2. I don’t see nRF24_ID40 library in your dir dump