hansgaensbauer / polkadot

A low cost LoRa mesh network using STM32 and the SX1276
16 stars 7 forks source link

STM32L073 #1

Open tcpipchip opened 2 years ago

tcpipchip commented 2 years ago

Hey can you put the GPIO map to SX1276 + STM32 connection ? Looks that you forgot the #defines to GPIOS For example XDONE_GPIO_Port and XDONE_Pin below the compile errors

tcpipchip commented 2 years ago

../Core/Src/main.c: In function 'MX_GPIO_Init': ../Core/Src/main.c:417:28: error: 'DATA_RDY_Pin' undeclared (first use in this function) 417 | HAL_GPIO_WritePin(GPIOB, DATA_RDY_Pin|LED_Pin, GPIO_PIN_RESET); | ^~~~ ../Core/Src/main.c:417:28: note: each undeclared identifier is reported only once for each function it appears in ../Core/Src/main.c:420:21: error: 'SX1276_CS_GPIO_Port' undeclared (first use in this function) 420 | HAL_GPIO_WritePin(SX1276_CS_GPIO_Port, SX1276_CS_Pin, GPIO_PIN_RESET); | ^~~~~~~ ../Core/Src/main.c:420:42: error: 'SX1276_CS_Pin' undeclared (first use in this function); did you mean 'SX1276_Init'? 420 | HAL_GPIO_WritePin(SX1276_CS_GPIO_Port, SX1276_CS_Pin, GPIO_PIN_RESET); | ^~~~~ | SX1276_Init ../Core/Src/main.c:429:25: error: 'XDONE_Pin' undeclared (first use in this function) 429 | GPIO_InitStruct.Pin = XDONE_Pin; | ^~~~~ ../Core/Src/main.c:432:17: error: 'XDONE_GPIO_Port' undeclared (first use in this function); did you mean 'LED_GPIO_Port'? 432 | HAL_GPIO_Init(XDONE_GPIO_Port, &GPIO_InitStruct); | ^~~~~~~ | LED_GPIO_Port ../Core/Src/sx1276.c: In function 'SX1276_Write_Register': ../Core/Src/sx1276.c:12:20: error: 'SX1276_CS_GPIO_Port' undeclared (first use in this function) 12 | HAL_GPIO_WritePin(SX1276_CS_GPIO_Port, SX1276_CS_Pin, GPIO_PIN_RESET); //activate CS | ^~~~~~~ ../Core/Src/sx1276.c:12:20: note: each undeclared identifier is reported only once for each function it appears in ../Core/Src/main.c:442:25: error: 'SPI2_AS_Pin' undeclared (first use in this function) 442 | GPIO_InitStruct.Pin = SPI2_AS_Pin; | ^~~ ../Core/Src/sx1276.c:12:41: error: 'SX1276_CS_Pin' undeclared (first use in this function); did you mean 'SX1276_Init'? 12 | HAL_GPIO_WritePin(SX1276_CS_GPIO_Port, SX1276_CS_Pin, GPIO_PIN_RESET); //activate CS | ^~~~~ | SX1276_Init ../Core/Src/main.c:445:17: error: 'SPI2_AS_GPIO_Port' undeclared (first use in this function) 445 | HAL_GPIO_Init(SPI2_AS_GPIO_Port, &GPIO_InitStruct); | ^~~~~ ../Core/Src/main.c: In function 'HAL_GPIO_EXTI_Callback': ../Core/Src/main.c:463:17: error: 'XDONE_Pin' undeclared (first use in this function) 463 | if(GPIO_Pin == XDONE_Pin && rx_flag){ | ^~~~~ ../Core/Src/sx1276.c: In function 'SX1276_Write_Burst': ../Core/Src/sx1276.c:26:20: error: 'SX1276_CS_GPIO_Port' undeclared (first use in this function) 26 | HAL_GPIO_WritePin(SX1276_CS_GPIO_Port, SX1276_CS_Pin, GPIO_PIN_RESET); //activate CS | ^~~~~~~ ../Core/Src/sx1276.c:26:41: error: 'SX1276_CS_Pin' undeclared (first use in this function); did you mean 'SX1276_Init'? 26 | HAL_GPIO_WritePin(SX1276_CS_GPIO_Port, SX1276_CS_Pin, GPIO_PIN_RESET); //activate CS | ^~~~~ | SX1276_Init ../Core/Src/main.c: In function 'spi_transfer': ../Core/Src/main.c:471:20: error: 'DATA_RDY_GPIO_Port' undeclared (first use in this function) 471 | HAL_GPIO_WritePin(DATA_RDY_GPIO_Port, DATA_RDY_Pin, GPIO_PIN_SET); | ^~~~~~ ../Core/Src/main.c:471:40: error: 'DATA_RDY_Pin' undeclared (first use in this function) 471 | HAL_GPIO_WritePin(DATA_RDY_GPIO_Port, DATA_RDY_Pin, GPIO_PIN_SET); | ^~~~ ../Core/Src/sx1276.c: In function 'SX1276_Read_Register': ../Core/Src/sx1276.c:38:20: error: 'SX1276_CS_GPIO_Port' undeclared (first use in this function) 38 | HAL_GPIO_WritePin(SX1276_CS_GPIO_Port, SX1276_CS_Pin, GPIO_PIN_RESET); //activate CS | ^~~~~~~ ../Core/Src/sx1276.c:38:41: error: 'SX1276_CS_Pin' undeclared (first use in this function); did you mean 'SX1276_Init'? 38 | HAL_GPIO_WritePin(SX1276_CS_GPIO_Port, SX1276_CS_Pin, GPIO_PIN_RESET); //activate CS | ^~~~~ | SX1276_Init ../Core/Src/main.c:472:29: error: 'SPI2_AS_GPIO_Port' undeclared (first use in this function) 472 | while (HAL_GPIO_ReadPin(SPI2_AS_GPIO_Port, SPI2_AS_Pin)); //wait for AS pin | ^~~~~ ../Core/Src/main.c:472:48: error: 'SPI2_AS_Pin' undeclared (first use in this function) 472 | while (HAL_GPIO_ReadPin(SPI2_AS_GPIO_Port, SPI2_AS_Pin)); //wait for AS pin | ^~~ ../Core/Src/sx1276.c: In function 'SX1276_Read_Burst': ../Core/Src/sx1276.c:48:20: error: 'SX1276_CS_GPIO_Port' undeclared (first use in this function) 48 | HAL_GPIO_WritePin(SX1276_CS_GPIO_Port, SX1276_CS_Pin, GPIO_PIN_RESET); //activate CS; | ^~~~~~~ make: [Core/Src/subdir.mk:40: Core/Src/main.o] Error 1 make: Waiting for unfinished jobs.... ../Core/Src/sx1276.c:48:41: error: 'SX1276_CS_Pin' undeclared (first use in this function); did you mean 'SX1276_Init'? 48 | HAL_GPIO_WritePin(SX1276_CS_GPIO_Port, SX1276_CS_Pin, GPIO_PIN_RESET); //activate CS; | ^~~~~ | SX1276_Init ../Core/Src/sx1276.c: In function 'SX1276_Transmit_Blocking': ../Core/Src/sx1276.c:117:26: error: 'XDONE_GPIO_Port' undeclared (first use in this function); did you mean 'LED_GPIO_Port'? 117 | while(!HAL_GPIO_ReadPin(XDONE_GPIO_Port, XDONE_Pin)); //wait for the transmit to finish //TODO - add timeout | ^~~~~~~ | LED_GPIO_Port ../Core/Src/sx1276.c:117:43: error: 'XDONE_Pin' undeclared (first use in this function) 117 | while(!HAL_GPIO_ReadPin(XDONE_GPIO_Port, XDONE_Pin)); //wait for the transmit to finish //TODO - add timeout | ^~~~~ ../Core/Src/sx1276.c: In function 'SX1276_Receive_Blocking': ../Core/Src/sx1276.c:150:26: error: 'XDONE_GPIO_Port' undeclared (first use in this function); did you mean 'LED_GPIO_Port'? 150 | while(!HAL_GPIO_ReadPin(XDONE_GPIO_Port, XDONE_Pin)){ | ^~~~~~~ | LED_GPIO_Port ../Core/Src/sx1276.c:150:43: error: 'XDONE_Pin' undeclared (first use in this function) 150 | while(!HAL_GPIO_ReadPin(XDONE_GPIO_Port, XDONE_Pin)){ | ^~~~~ make: *** [Core/Src/subdir.mk:40: Core/Src/sx1276.o] Error 1 "make -j4 all" terminated with exit code 2. Build might be incomplete.