hello,will you please tell me which code i have to use in the sdk 12.2.0 for rf communication with nrf51822 and nrf24l01 .and also tell me which settings i have to do for nrf24l01 side as a transmitter.so that i can receive data on nrf51822 side.
hello,will you please tell me which code i have to use in the sdk 12.2.0 for rf communication with nrf51822 and nrf24l01 .and also tell me which settings i have to do for nrf24l01 side as a transmitter.so that i can receive data on nrf51822 side.
Hi Pallavi
You should be able to find the project here
Please note that it has only been tested on the nRF52DK. I only confirmed that it compiled on the nRF51DK, but didn't have time to test it.
The pins used for the nRF24L01+ module is 11, 12, 13, 14, 15, 16, which corresponds to CE, CSN, SCK, MOSI, MISO, IRQ (in that order).
Best regards
hello sir, thank you for the code but i am not getting how can i use this code for the rf communication. on one side i am using the arduio with nrf24l01 through SPI.and i am looking for the code on arduino platform so that i can easily communicate with nrf51.the code here you had given on keil platform.thats why i am confused now.i am not getting what can i do now.but thank you for your code. Pallavi
Hi Pallavi
You can use the attached code to verify that the nRF24L01 module is working correctly, and is able to communicate with your nRF51 kit (you just need a separate nRF51 kit to run the nRF24L01).
You can also use it to compare the register values and the control signals for the nRF24L01 module, and see how they differ from your Arduino implementation.
With that information in place it would hopefully be easier for you to see what is wrong on the Arduino side (assuming of course your L01 module works fine).
Since I don't have your hardware I can't really test that on my side.
Best regards
sir, i at one point i am succesful for achieving communication between nrf51822 and nrf24l01.but there is one problem i am facing now i am receiving interrupt from nrf24l01 but at the receiver end i am not getting any data. for which i had used the code from sdk 12.2.0 from the folder examples/peripherals/radio in this code the settings given for nrf24 series, these are as follows, uint8_t tx_address[5] = { 0xC0, 0x01, 0x23, 0x45, 0x67 };
hello sir, i have compiled your code in C:\nRF5_SDK_12.2.0_f012efa\examples\proprietary_rf\l01_test_app\esb_ptx\pca10028\blank\arm5_no_packs folder but it is showing errors.and you told that you have compiled this code in the nrf51 DK.but in my case it is not getting compiled.will you please tell me the path i have followed to locate this code right or wrong.if wrong path then may be it is showing that errors the errors are as,
..............\components\drivers_nrf\uart\nrf_drv_uart.c: 13 warnings, 30 errors compiling app_uart_fifo.c... compiling retarget.c... compiling app_fifo.c... compiling app_error.c... compiling app_error_weak.c... ..............\components\libraries\log\src\nrf_log_ctrl_internal.h(26): error: #260-D: explicit type is missing ("int" assumed) nrf_log_init(timestamp_func) ..............\components\libraries\log\src\nrf_log_ctrl_internal.h(26): warning: #1294-D: Old-style function nrf_log_init nrf_log_init(timestamp_func) ..............\components\libraries\log\nrf_log_ctrl.h(35): warning: #99-D: a declaration here must declare a parameter typedef uint32_t (*nrf_log_timestamp_func_t)(void); ..............\components\libraries\log\nrf_log_ctrl.h(35): warning: #231-D: declaration is not visible outside of function typedef uint32_t (*nrf_log_timestamp_func_t)(void); ..............\components\libraries\log\nrf_log_ctrl.h(99): warning: #99-D: a declaration here must declare a parameter typedef bool (*nrf_log_std_handler_t)( ..............\components\libraries\log\nrf_log_ctrl.h(99): warning: #231-D: declaration is not visible outside of function typedef bool (*nrf_log_std_handler_t)( ..............\components\libraries\log\nrf_log_ctrl.h(125): warning: #99-D: a declaration here must declare a parameter typedef uint32_t (*nrf_log_hexdump_handler_t)( ..............\components\libraries\log\nrf_log_ctrl.h(125): warning: #231-D: declaration is not visible outside of function typedef uint32_t (*nrf_log_hexdump_handler_t)( ..............\components\libraries\log\nrf_log_ctrl.h(148): error: #99: a declaration here must declare a parameter ret_code_t nrf_log_init(nrf_log_timestamp_func_t timestamp_func); ..............\components\libraries\log\nrf_log_ctrl.h(153): error: #99: a declaration here must declare a parameter ret_code_t nrf_log_blocking_backend_set(void); ..............\components\libraries\log\nrf_log_ctrl.h(169): error: #99: a declaration here must declare a parameter void nrf_log_frontend_init(nrf_log_std_handler_t std_handler, ..............\components\libraries\log\nrf_log_ctrl.h(182): error: #99: a declaration here must declare a parameter void nrf_log_handlers_set(nrf_log_std_handler_t std_handler, ..............\components\libraries\log\nrf_log_ctrl.h(194): error: #99: a declaration here must declare a parameter
ool nrf_log_frontend_dequeue(void); ..............\components\libraries\util\app_error_weak.c(24): warning: #85-D: invalid storage class for a parameter
_WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info) ..............\components\libraries\util\app_error_weak.c(24): error: #99: a declaration here must declare a parameter __WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info) ..............\components\libraries\util\app_error_weak.c(25): error: #65: expected a ";" { ..............\components\libraries\util\app_error_weak.c(38): warning: At end of source: #12-D: parsing restarts here after previous syntax error ..............\components\libraries\log\src\nrf_log_ctrl_internal.h(26): warning: #1079-D: standard requires that parameter "timestamp_func" be given a type by a subsequent declaration ("int" assumed) nrf_log_init(timestamp_func) ..............\components\libraries\util\app_error_weak.c(38): error: At end of source: #130: expected a "{" ..............\components\libraries\util\app_error_weak.c(38): error: At end of source: #67: expected a "}" ..............\components\libraries\util\app_error_weak.c: 10 warnings, 10 errors compiling app_util_platform.c... compiling nrf_log_backend_serial.c... ..............\components\libraries\log\src\nrf_log_ctrl_internal.h(26): error: #260-D: explicit type is missing ("int" assumed) nrf_log_init(timestamp_func) ..............\components\libraries\log\src\nrf_log_ctrl_internal.h(26): warning: #1294-D: Old-style function nrf_log_init nrf_log_init(timestamp_func) ..............\components\libraries\log\nrf_log_ctrl.h(35): warning: #99-D: a declaration here must declare a parameter typedef uint32_t (*nrf_log_timestamp_func_t)(void); ..............\components\libraries\log\nrf_log_ctrl.h(35): warning: #231-D: declaration is not visible outside of function typedef uint32_t (*nrf_log_timestamp_func_t)(void); ..............\components\libraries\log\nrf_log_ctrl.h(99): warning: #99-D: a declaration here must declare a parameter typedef bool (*nrf_log_std_handler_t)( ..............\components\libraries\log\nrf_log_ctrl.h(99): warning: #231-D: declaration is not visible outside of function typedef bool (*nrf_log_std_handler_t)( ..............\components\libraries\log\nrf_log_ctrl.h(125): warning: #99-D: a declaration here must declare a parameter typedef uint32_t (*nrf_log_hexdump_handler_t)( ..............\components\libraries\log\nrf_log_ctrl.h(125): warning: #231-D: declaration is not visible outside of function typedef uint32_t (*nrf_log_hexdump_handler_t)( ..............\components\libraries\log\nrf_log_ctrl.h(148): error: #99: a declaration here must declare a parameter ret_code_t nrf_log_init(nrf_log_timestamp_func_t timestamp_func); ..............\components\libraries\log\nrf_log_ctrl.h(153): error: #99: a declaration here must declare a parameter ret_code_t nrf_log_blocking_backend_set(void); ..............\components\libraries\log\nrf_log_ctrl.h(169): error: #99: a declaration here must declare a parameter void nrf_log_frontend_init(nrf_log_std_handler_t std_handler, ..............\components\libraries\log\nrf_log_ctrl.h(182): error: #99: a declaration here must declare a parameter void nrf_log_handlers_set(nrf_log_std_handler_t std_handler, ..............\components\libraries\log\nrf_log_ctrl.h(194): error: #99: a declaration here must declare a parameter
ool nrf_log_frontend_dequeue(void); ..............\components\libraries\log\nrf_log_backend.h(38): error: #99: a declaration here must declare a parameter ret_code_t nrf_log_backend_init( ool blocking); ..............\components\libraries\log\nrf_log_backend.h(46): error: #99: a declaration here must declare a parameter nrf_log_std_handler_t nrf_log_backend_std_handler_get(void); ..............\components\libraries\log\nrf_log_backend.h(54): error: #99: a declaration here must declare a parameter nrf_log_hexdump_handler_t nrf_log_backend_hexdump_handler_get(void); ..............\components\libraries\log\nrf_log_backend.h(61): error: #99: a declaration here must declare a parameter uint8_t nrf_log_backend_getchar(void); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(134): error: #85: invalid storage class for a parameter extern ARMABI_PURE unsigned char **__rt_ctype_table(void); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(134): error: #99: a declaration here must declare a parameter extern ARMABI_PURE unsigned char **__rt_ctype_table(void); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(134): error: #3108: attribute "__nothrow" does not apply here extern ARMABI_PURE unsigned char **__rt_ctype_table(void); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(142): error: #85: invalid storage class for a parameter extern int (isalnum)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(142): error: #99: a declaration here must declare a parameter extern int (isalnum)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(150): error: #85: invalid storage class for a parameter extern int (isalpha)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(150): error: #99: a declaration here must declare a parameter extern int (isalpha)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(158): error: #85: invalid storage class for a parameter extern int (iscntrl)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(158): error: #99: a declaration here must declare a parameter extern int (iscntrl)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(168): error: #85: invalid storage class for a parameter extern int (isdigit)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(168): error: #99: a declaration here must declare a parameter extern int (isdigit)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(172): error: #85: invalid storage class for a parameter extern int (isblank)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(172): error: #99: a declaration here must declare a parameter extern int (isblank)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(181): error: #85: invalid storage class for a parameter extern int (isgraph)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(181): error: #99: a declaration here must declare a parameter extern int (isgraph)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(189): error: #85: invalid storage class for a parameter extern int (islower)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(189): error: #99: a declaration here must declare a parameter extern int (islower)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(197): error: #85: invalid storage class for a parameter extern int (isprint)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(197): error: #99: a declaration here must declare a parameter extern int (isprint)(int /c/); C:\Keil_v5\ARM\ARMCC\Bin..\include\ctype.h(206): error: #85: invalid storage class for a parameter extern int (ispunct)(int /c/); ..............\components\libraries\log\src\nrf_log_backend_serial.c: 7 warnings, 30 errors compiling nrf_log_frontend.c... ..............\components\libraries\log\src\nrf_log_ctrl_internal.h(26): error: #260-D: explicit type is missing ("int" assumed) nrf_log_init(timestamp_func) ..............\components\libraries\log\src\nrf_log_ctrl_internal.h(26): warning: #1294-D: Old-style function nrf_log_init nrf_log_init(timestamp_func) ..............\components\libraries\log\nrf_log_ctrl.h(35): warning: #99-D: a declaration here must declare a parameter typedef uint32_t (*nrf_log_timestamp_func_t)(void); ..............\components\libraries\log\nrf_log_ctrl.h(35): warning: #231-D: declaration is not visible outside of function typedef uint32_t (*nrf_log_timestamp_func_t)(void); ..............\components\libraries\log\nrf_log_ctrl.h(99): warning: #99-D: a declaration here must declare a parameter typedef bool (*nrf_log_std_handler_t)( ..............\components\libraries\log\nrf_log_ctrl.h(99): warning: #231-D: declaration is not visible outside of function typedef bool (*nrf_log_std_handler_t)( ..............\components\libraries\log\nrf_log_ctrl.h(125): warning: #99-D: a declaration here must declare a parameter typedef uint32_t (*nrf_log_hexdump_handler_t)( ..............\components\libraries\log\nrf_log_ctrl.h(125): warning: #231-D: declaration is not visible outside of function typedef uint32_t (*nrf_log_hexdump_handler_t)( ..............\components\libraries\log\nrf_log_ctrl.h(148): error: #99: a declaration here must declare a parameter ret_code_t nrf_log_init(nrf_log_timestamp_func_t timestamp_func); ..............\components\libraries\log\nrf_log_ctrl.h(153): error: #99: a declaration here must declare a parameter ret_code_t nrf_log_blocking_backend_set(void); ..............\components\libraries\log\nrf_log_ctrl.h(169): error: #99: a declaration here must declare a parameter void nrf_log_frontend_init(nrf_log_std_handler_t std_handler, ..............\components\libraries\log\nrf_log_ctrl.h(182): error: #99: a declaration here must declare a parameter void nrf_log_handlers_set(nrf_log_std_handler_t std_handler, ..............\components\libraries\log\nrf_log_ctrl.h(194): error: #99: a declaration here must declare a parameter
ool nrf_log_frontend_dequeue(void); ..............\components\libraries\log\nrf_log_backend.h(38): error: #99: a declaration here must declare a parameter ret_code_t nrf_log_backend_init( ool blocking); ..............\components\libraries\log\nrf_log_backend.h(46): error: #99: a declaration here must declare a parameter nrf_log_std_handler_t nrf_log_backend_std_handler_get(void); ..............\components\libraries\log\nrf_log_backend.h(54): error: #99: a declaration here must declare a parameter nrf_log_hexdump_handler_t nrf_log_backend_hexdump_handler_get(void); ..............\components\libraries\log\nrf_log_backend.h(61): error: #99: a declaration here must declare a parameter uint8_t nrf_log_backend_getchar(void); ..............\components\libraries\log\src\nrf_log_frontend.c(36): warning: #99-D: a declaration here must declare a parameter typedef struct ..............\components\libraries\log\src\nrf_log_frontend.c(45): warning: #231-D: declaration is not visible outside of function } log_data_t; ..............\components\libraries\log\src\nrf_log_frontend.c(47): error: #85: invalid storage class for a parameter static log_data_t m_log_data; ..............\components\libraries\log\src\nrf_log_frontend.c(47): error: #99: a declaration here must declare a parameter static log_data_t m_log_data; ..............\components\libraries\log\src\nrf_log_frontend.c(116): warning: #99-D: a declaration here must declare a parameter typedef struct ..............\components\libraries\log\src\nrf_log_frontend.c(121): warning: #231-D: declaration is not visible outside of function } nrf_log_generic_header_t; ..............\components\libraries\log\src\nrf_log_frontend.c(123): warning: #99-D: a declaration here must declare a parameter typedef struct ..............\components\libraries\log\src\nrf_log_frontend.c(130): warning: #231-D: declaration is not visible outside of function } nrf_log_std_header_t; ..............\components\libraries\log\src\nrf_log_frontend.c(132): warning: #99-D: a declaration here must declare a parameter typedef struct ..............\components\libraries\log\src\nrf_log_frontend.c(140): warning: #231-D: declaration is not visible outside of function } nrf_log_hexdump_header_t; ..............\components\libraries\log\src\nrf_log_frontend.c(142): warning: #99-D: a declaration here must declare a parameter typedef struct ..............\components\libraries\log\src\nrf_log_frontend.c(149): warning: #231-D: declaration is not visible outside of function } nrf_log_pushed_header_t; ..............\components\libraries\log\src\nrf_log_frontend.c(151): warning: #99-D: a declaration here must declare a parameter typedef union ..............\components\libraries\log\src\nrf_log_frontend.c(158): warning: #231-D: declaration is not visible outside of function } nrf_log_header_t; ..............\components\libraries\log\src\nrf_log_frontend.c(233): error: #99: a declaration here must declare a parameter ret_code_t nrf_log_init(nrf_log_timestamp_func_t timestamp_func) ..............\components\libraries\log\src\nrf_log_frontend.c(233): error: #101: "nrf_log_init" has already been declared in the current scope ret_code_t nrf_log_init(nrf_log_timestamp_func_t timestamp_func) ..............\components\libraries\log\src\nrf_log_frontend.c(234): error: #65: expected a ";" { ..............\components\libraries\log\src\nrf_log_frontend.c(652): warning: #12-D: parsing restarts here after previous syntax error while (curr_offset < length); ..............\components\libraries\log\src\nrf_log_ctrl_internal.h(26): warning: #1079-D: standard requires that parameter "timestamp_func" be given a type by a subsequent declaration ("int" assumed) nrf_log_init(timestamp_func) ..............\components\libraries\log\src\nrf_log_frontend.c(678): error: #130: expected a "{" } ..............\components\libraries\log\src\nrf_log_frontend.c(683): error: #20: identifier "m_log_data" is undefined return (m_log_data.rd_idx == m_log_data.wr_idx); ..............\components\libraries\log\src\nrf_log_frontend.c(694): error: #20: identifier "m_log_data" is undefined uint32_t rd_idx = m_log_data.rd_idx; ..............\components\libraries\log\src\nrf_log_frontend.c(698): error: #20: identifier "nrf_log_header_t" is undefined nrf_log_header_t header; ..............\components\libraries\log\src\nrf_log_frontend.c(795): warning: #223-D: function "nrf_log_backend_getchar" declared implicitly return nrf_log_backend_getchar(); ..............\components\libraries\log\src\nrf_log_frontend.c: 22 warnings, 19 errors compiling RTT_Syscalls_KEIL.c... compiling SEGGER_RTT.c... compiling SEGGER_RTT_printf.c... assembling arm_startup_nrf51.s... compiling system_nrf51.c... "._build\nrf51422_xxac.axf" - 115 Error(s), 70 Warning(s). Target not created. Build Time Elapsed: 00:00:07
please tell me why its happened.
Pallavi