Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. transmission and reception problems with stm32f103c8 and nrf24 library

transmission and reception problems with stm32f103c8 and nrf24 library

Scheduled Pinned Locked Moved Troubleshooting
3 Posts 3 Posters 68 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Croma NnonC Offline
    Croma NnonC Offline
    Croma Nnon
    wrote on last edited by
    #1

    hello, i am developing my project in a stm32f103c8 (bluepill) with Keil and CubeMX, i want to use a nrf24l01 transmitter and for this i looked for a tutorial which is exactly what i want to do. the problem is that when i do it i notice that the radio transceiver does not transmit or receive, i have seen on the internet that some people have problems with this card that i am using, just me this is failing me using this library. I leave a link to a video that shows the same steps that I made in addition to the library. precisely the function nrf24_write is the one that is not working. I hope you can help me because I've been trying to understand why it does not work for several days.

    link video:

    https://www.youtube.com/watch?v=O2dg2Eo7vo8

    link library:

    https://github.com/MYaqoobEmbedded/STM32-Tutorials/tree/master/Tutorial 24 - NRF24L01 Radio Transceiver

    main code:

    /* Includes ------------------------------------------------------------------*/
    #include "main.h"
     
    /* Private includes ----------------------------------------------------------*/
    /* USER CODE BEGIN Includes */
    #include "MY_NRF24.h"
    #include "stdio.h"
    /* USER CODE END Includes */
     
    /* Private typedef -----------------------------------------------------------*/
    /* USER CODE BEGIN PTD */
     
    /* USER CODE END PTD */
     
    /* Private define ------------------------------------------------------------*/
    /* USER CODE BEGIN PD */
    /* USER CODE END PD */
     
    /* Private macro -------------------------------------------------------------*/
    /* USER CODE BEGIN PM */
     
    /* USER CODE END PM */
     
    /* Private variables ---------------------------------------------------------*/
    SPI_HandleTypeDef hspi1;
     
    UART_HandleTypeDef huart1;
     
    /* USER CODE BEGIN PV */
     
    /* USER CODE END PV */
     
    /* Private function prototypes -----------------------------------------------*/
    void SystemClock_Config(void);
    static void MX_GPIO_Init(void);
    static void MX_SPI1_Init(void);
    static void MX_USART1_UART_Init(void);
    /* USER CODE BEGIN PFP */
     
    /* USER CODE END PFP */
     
    /* Private user code ---------------------------------------------------------*/
    /* USER CODE BEGIN 0 */
    uint64_t TxpipeAddrs = 0x324e6f6465;
    char myTxData[32]; //= "Hello World!";
    char AckPayload[32];
    /* USER CODE END 0 */
     
    /**
      * @brief  The application entry point.
      * @retval int
      */
    int main(void)
    {
      /* USER CODE BEGIN 1 */
    	myTxData[0]= 0;
      /* USER CODE END 1 */
     
      /* MCU Configuration--------------------------------------------------------*/
     
      /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
      HAL_Init();
     
      /* USER CODE BEGIN Init */
     
      /* USER CODE END Init */
     
      /* Configure the system clock */
      SystemClock_Config();
     
      /* USER CODE BEGIN SysInit */
     
      /* USER CODE END SysInit */
     
      /* Initialize all configured peripherals */
      MX_GPIO_Init();
      MX_SPI1_Init();
      MX_USART1_UART_Init();
      /* USER CODE BEGIN 2 */
    	NRF24_begin(GPIOB, GPIO_PIN_8, GPIO_PIN_9, hspi1);
    	nrf24_DebugUART_Init(huart1);
    	
    	
    	
    	//**** TRANSMIT - ACK ****//
    	
    	NRF24_setPALevel(RF_PWR_HIGH);
    	NRF24_openWritingPipe(TxpipeAddrs);
     
    	NRF24_setAutoAck(true);
    	NRF24_setChannel(52);
    	NRF24_setPayloadSize(32);
    	NRF24_setDataRate(RF24_2MBPS);
    	
    	NRF24_enableDynamicPayloads();
    	NRF24_enableAckPayload();
    	NRF24_stopListening();
    	HAL_Delay(1000);
    	printRadioSettings();
      /* USER CODE END 2 */
     
      /* Infinite loop */
      /* USER CODE BEGIN WHILE */
      while (1)
      {
        /* USER CODE END WHILE */
    		if(NRF24_write(myTxData, 32))
    		{
    			NRF24_read(AckPayload, 32);
    			HAL_UART_Transmit(&huart1, (uint8_t *)"Transmitted Successfully\r\n", strlen("Transmitted Successfully\r\n"), 10);
    			
    			char myDataack[80];
    			sprintf(myDataack, "AckPayload:  %s \r\n", AckPayload);
    			HAL_UART_Transmit(&huart1, (uint8_t *)myDataack, strlen(myDataack), 10);
    		}else{
    					HAL_UART_Transmit(&huart1, (uint8_t *)"Transmitted Failed\r\n", strlen("Transmitted Failed\r\n"), 10);}
    		myTxData[0]= myTxData[0] + 1;
    		HAL_Delay(1000);
        /* USER CODE BEGIN 3 */
      }
      /* USER CODE END 3 */
    }
    
    skywatchS 1 Reply Last reply
    0
    • E Offline
      E Offline
      ejlane
      wrote on last edited by
      #2

      Well, I don't know what all is in the video, because I'm not going to watch a 27 minute video about it.

      However, those modules often fail due to bad power supply. Adding some capacitance to the power rail is supposed to take care of it. I've read about it multiple times, but I haven't used them hardly at all myself.

      1 Reply Last reply
      0
      • Croma NnonC Croma Nnon

        hello, i am developing my project in a stm32f103c8 (bluepill) with Keil and CubeMX, i want to use a nrf24l01 transmitter and for this i looked for a tutorial which is exactly what i want to do. the problem is that when i do it i notice that the radio transceiver does not transmit or receive, i have seen on the internet that some people have problems with this card that i am using, just me this is failing me using this library. I leave a link to a video that shows the same steps that I made in addition to the library. precisely the function nrf24_write is the one that is not working. I hope you can help me because I've been trying to understand why it does not work for several days.

        link video:

        https://www.youtube.com/watch?v=O2dg2Eo7vo8

        link library:

        https://github.com/MYaqoobEmbedded/STM32-Tutorials/tree/master/Tutorial 24 - NRF24L01 Radio Transceiver

        main code:

        /* Includes ------------------------------------------------------------------*/
        #include "main.h"
         
        /* Private includes ----------------------------------------------------------*/
        /* USER CODE BEGIN Includes */
        #include "MY_NRF24.h"
        #include "stdio.h"
        /* USER CODE END Includes */
         
        /* Private typedef -----------------------------------------------------------*/
        /* USER CODE BEGIN PTD */
         
        /* USER CODE END PTD */
         
        /* Private define ------------------------------------------------------------*/
        /* USER CODE BEGIN PD */
        /* USER CODE END PD */
         
        /* Private macro -------------------------------------------------------------*/
        /* USER CODE BEGIN PM */
         
        /* USER CODE END PM */
         
        /* Private variables ---------------------------------------------------------*/
        SPI_HandleTypeDef hspi1;
         
        UART_HandleTypeDef huart1;
         
        /* USER CODE BEGIN PV */
         
        /* USER CODE END PV */
         
        /* Private function prototypes -----------------------------------------------*/
        void SystemClock_Config(void);
        static void MX_GPIO_Init(void);
        static void MX_SPI1_Init(void);
        static void MX_USART1_UART_Init(void);
        /* USER CODE BEGIN PFP */
         
        /* USER CODE END PFP */
         
        /* Private user code ---------------------------------------------------------*/
        /* USER CODE BEGIN 0 */
        uint64_t TxpipeAddrs = 0x324e6f6465;
        char myTxData[32]; //= "Hello World!";
        char AckPayload[32];
        /* USER CODE END 0 */
         
        /**
          * @brief  The application entry point.
          * @retval int
          */
        int main(void)
        {
          /* USER CODE BEGIN 1 */
        	myTxData[0]= 0;
          /* USER CODE END 1 */
         
          /* MCU Configuration--------------------------------------------------------*/
         
          /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
          HAL_Init();
         
          /* USER CODE BEGIN Init */
         
          /* USER CODE END Init */
         
          /* Configure the system clock */
          SystemClock_Config();
         
          /* USER CODE BEGIN SysInit */
         
          /* USER CODE END SysInit */
         
          /* Initialize all configured peripherals */
          MX_GPIO_Init();
          MX_SPI1_Init();
          MX_USART1_UART_Init();
          /* USER CODE BEGIN 2 */
        	NRF24_begin(GPIOB, GPIO_PIN_8, GPIO_PIN_9, hspi1);
        	nrf24_DebugUART_Init(huart1);
        	
        	
        	
        	//**** TRANSMIT - ACK ****//
        	
        	NRF24_setPALevel(RF_PWR_HIGH);
        	NRF24_openWritingPipe(TxpipeAddrs);
         
        	NRF24_setAutoAck(true);
        	NRF24_setChannel(52);
        	NRF24_setPayloadSize(32);
        	NRF24_setDataRate(RF24_2MBPS);
        	
        	NRF24_enableDynamicPayloads();
        	NRF24_enableAckPayload();
        	NRF24_stopListening();
        	HAL_Delay(1000);
        	printRadioSettings();
          /* USER CODE END 2 */
         
          /* Infinite loop */
          /* USER CODE BEGIN WHILE */
          while (1)
          {
            /* USER CODE END WHILE */
        		if(NRF24_write(myTxData, 32))
        		{
        			NRF24_read(AckPayload, 32);
        			HAL_UART_Transmit(&huart1, (uint8_t *)"Transmitted Successfully\r\n", strlen("Transmitted Successfully\r\n"), 10);
        			
        			char myDataack[80];
        			sprintf(myDataack, "AckPayload:  %s \r\n", AckPayload);
        			HAL_UART_Transmit(&huart1, (uint8_t *)myDataack, strlen(myDataack), 10);
        		}else{
        					HAL_UART_Transmit(&huart1, (uint8_t *)"Transmitted Failed\r\n", strlen("Transmitted Failed\r\n"), 10);}
        		myTxData[0]= myTxData[0] + 1;
        		HAL_Delay(1000);
            /* USER CODE BEGIN 3 */
          }
          /* USER CODE END 3 */
        }
        
        skywatchS Offline
        skywatchS Offline
        skywatch
        wrote on last edited by
        #3

        @Croma-Nnon You know this forum is for MySensors right?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        22

        Online

        11.7k

        Users

        11.2k

        Topics

        113.1k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular