Example code for NRF24LE1 SDK?

Questions for programming 8051 microcontrollers in C or assembly using SDCC

Example code for NRF24LE1 SDK?

Postby janekm » Mon Mar 07, 2011 5:33 pm

Hi,

thanks a lot for writing the NRF24LE1 SDK, it looks very nicely written. I was wondering if you have any examples of using the SDK though, just to see how everything ties together and make sure that the basic configuration of the chip is taken care of, for example setting up the timers correctly for the radio? Something like a simple TX+RX example?

Thanks a lot in advance,
Janek
janekm
 
Posts: 1
Joined: Mon Mar 07, 2011 5:26 pm

Re: Example code for NRF24LE1 SDK?

Postby brennen » Tue Mar 08, 2011 1:02 pm

On each of the product pages, there is a link to an RF example. It is simply a translation of my tutorial 1 to work on the 24LE1 boards. If you unzip it to the same parent folder as your nrf24le1_sdk folder, then you should be able to compile and link the applications. If you are running Windows, you will need to make sure you download Cygwin (make sure you get the make utility when you install Cygwin). You will also need to download SDCC to compile the project. If you have Eclipse IDE, you can import the project into Eclipse and compile it from there, as there is an Eclipse project within the RF application.

There is a bug in one of the files, however. In <unzip_location>/nrf24le1_tut_1_remote/src/main/src/main.c, line 53 should be changed from

Code: Select all
rf_configure_debug_lite(false, 1); //initialize the rf to the debug configuration as TX, 1 data bytes, and auto-ack disabled


to

Code: Select all
rf_configure_debug_lite(true, 1); //initialize the rf to the debug configuration as RX, 1 data bytes, and auto-ack disabled

and then rebuild the code. I will fix this when I roll out the newer version of the SDK.
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: Example code for NRF24LE1 SDK?

Postby thoward » Wed Oct 07, 2015 12:25 am

This is an old thread but I was wondering where the tutorial for the NRF24LE1 is that you speak of? Thanks Brennen
thoward
 
Posts: 1
Joined: Wed Oct 07, 2015 12:10 am

Re: Example code for NRF24LE1 SDK?

Postby brennen » Wed Oct 07, 2015 2:11 pm

The tutorials can be found at www.diyembedded.com, with links on the right side of the page.
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: Example code for NRF24LE1 SDK?

Postby dwery » Wed Dec 02, 2015 11:37 pm

Hello,

I've tried nrf24le1_tut_1_remote and it compiled (one target_nrf24le1_sdk.h was in place)
with the 2.0 sdk. I've tried with the 4.0 and got several errors.

Have you got a document explaining the differences between 2.0 and 4.0? It is
worthwhile to try building with the latter?

thanks.
dwery
 
Posts: 3
Joined: Wed Dec 02, 2015 11:15 pm

Re: Example code for NRF24LE1 SDK?

Postby brennen » Thu Dec 03, 2015 1:27 pm

Can you paste your build output? I unfortunately didn't document the changes between the two SDK versions.
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: Example code for NRF24LE1 SDK?

Postby dwery » Thu Dec 03, 2015 6:06 pm

Hello,

the firs error is
Code: Select all
src/main.c:42: warning 112: function 'gpio_pin_val_complement_sbit' implicit declaration


I commented it and it later fails with the following. It sounds like a linking issue.
I've used sdcc 3.1.0

Code: Select all
Linking project
sdcc --model-large --code-loc 0x0000 --code-size 0x4000 --xram-loc 0x0000 --xram-size 0x400 -o flash/main.ihx -L ../../nrf24le1_sdk/_target_sdcc_nrf24le1/lib  obj/main/main.rel
?ASlink-Warning-Undefined Global '_rf_read_rx_payload' referenced by module 'main'
?ASlink-Warning-Undefined Global '_rf_configure_debug_lite' referenced by module 'main'
?ASlink-Warning-Undefined Global '_rf_spi_execute_command_PARM_2' referenced by module 'main'
?ASlink-Warning-Undefined Global '_rf_spi_execute_command_PARM_3' referenced by module 'main'
?ASlink-Warning-Undefined Global '_rf_spi_execute_command_PARM_4' referenced by module 'main'
?ASlink-Warning-Undefined Global '_gpio_pin_configure' referenced by module 'main'
?ASlink-Warning-Undefined Global '_rf_write_tx_payload' referenced by module 'main'
?ASlink-Warning-Undefined Global '_rf_set_as_rx' referenced by module 'main'
?ASlink-Warning-Undefined Global '_rf_irq_clear_all' referenced by module 'main'
?ASlink-Warning-Undefined Global '_rf_set_as_tx' referenced by module 'main'
?ASlink-Warning-Undefined Global '_rf_read_rx_payload_PARM_2' referenced by module 'main'
?ASlink-Warning-Undefined Global '_rf_configure_debug_lite_PARM_2' referenced by module 'main'
?ASlink-Warning-Undefined Global '_rf_spi_execute_command' referenced by module 'main'
?ASlink-Warning-Undefined Global '_delay_us' referenced by module 'main'
?ASlink-Warning-Undefined Global '_rf_write_tx_payload_PARM_2' referenced by module 'main'
?ASlink-Warning-Undefined Global '_gpio_pin_configure_PARM_2' referenced by module 'main'
?ASlink-Warning-Undefined Global '_rf_write_tx_payload_PARM_3' referenced by module 'main'
make[1]: *** [link] Error 1
make[1]: Leaving directory `/root/nrf24le1_tut_1_remote/_target_sdcc_nrf24le1'
make: *** [make_sdcc_nrf24le1] Error 2
dwery
 
Posts: 3
Joined: Wed Dec 02, 2015 11:15 pm

Re: Example code for NRF24LE1 SDK?

Postby brennen » Thu Dec 03, 2015 9:50 pm

Are the SDK folder and your project under the same parent folder? If not, the link won't work properly.
brennen
Site Admin
 
Posts: 395
Joined: Sun Aug 17, 2008 2:15 pm

Re: Example code for NRF24LE1 SDK?

Postby dwery » Thu Dec 03, 2015 10:24 pm

Yes they are. The problem was in this path: ../../nrf24le1_sdk/_target_sdcc_nrf24le1/lib
Which does not exists. I symlinked it to _target_sdcc_nrf24le1_48 and it worked.

Now the plan is to make a programmer that uses /dev/spidevX while waiting for my nrf24LE1
to arrive.

Thank you.
dwery
 
Posts: 3
Joined: Wed Dec 02, 2015 11:15 pm


Return to 8051 Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron