Configuration of multiple UARTS

I want to use multiple UARTS simultaneously. I’m currently developing for the STM32F407 Discovery board, but plan to support other platforms later, particularly LPC2468. My development environment is linux+gcc+cmake (using CLion). I cannot currently see how the signature for the user-supplied function… ~~~c void HALUARTMspInit(UARTHandleTypeDef *huart); ~~~ …gives me the information I need to decide which UART resources to configure. The structure UARTHandleTypeDef doesn’t appear to contain any fields that will tell me. I suppose I could do something like… ~~~c

define NUM_UARTS 2

UARTHandleTypeDef uarts[NUMUARTS]; … void HALUARTMspInit(UART_HandleTypeDef *huart) { if (huart == &uarts[0]) { // Initialisation for first UART here } else if (huart == &uarts[1]) { // Initialisation for second UART here } else if (…) { } // etc. } ~~~ …but this seems half-baked to me. What have I missed? Should I be eating more leafy greens? EDIT: Looking around, I see that the function I identified is just an STM32 thing. I forgot that the “HAL” was an STM32 scheme, so maybe this post doesn’t belong in a general FreeRTOS discussion. I’m actually working with the FreeRTOS Labs FreeRTOSPlusTCPandFAT_STM32F4xxx demo code. Still, maybe somebody out there has a perspective on this problem. Cheers Murray

Configuration of multiple UARTS

I’m afraid I don’t have a clue as you are asking about a third party piece of software I’m not familiar with. I don’t think this is a FreeRTOS question – correct me if I’m wrong.

Configuration of multiple UARTS

Yes, sorry, I’m working with a FreeRTOS port (STM32F4xx), but misattributed the function I identified due to the letters “HAL” (as mentioned in my edit). It was late at night, and I forgot that the HAL was from ST to abstract away STM32 variants. If I could have changed the title of the post to reflect this then I would have. I’ll head towards the STM32 fora. Ta.