cancel
Showing results for 
Search instead for 
Did you mean: 

Can you tell me how to set up serial port in keil?

yjae
Associate II

I'm a beginner. I'd appreciate your help.

27 REPLIES 27
yjae
Associate II

'.\sx1272mb2das\NUCLEO_CUBE_LORA.axf: Error: L6218E: Undefined symbol __HAL_RCC_UART4_CLK_ENABLE '

I didn't define 'HAL_RCC_UART4_CLK_ENABLE' but the same error appears above.What's the problem?

yjae
Associate II

void USART4_5_IRQHandler(void)

{

..

}

What is this part?

Is it true that there is no content?

This would be the body for a handler routine which would need to exist if you are generating interrupts. The vector table would cause it's execution.

You'd need to add your own servicing code.

>>I'm a beginner. 

Need to learn how the processor functions, try some of Joseph Yiu's books, perhaps the Essential Cortex-M0 one if that's your initial target.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
yjae
Associate II

umm

yjae
Associate II

Thank you. I ordered a book.But I don't have enough time.

Did you usart4 on pc10,pc11? (Source above)I'm confused because it's different from what I made out of Cubemx. Ping-pong works well with the sauce you gave me.

CubeMX does things differently, mainly spreading code all over the place, I prefer to use SPL/HAL where I put all the initialization in one place, where the order/sequence is clearer and more apparent. I don't particularly like CubeMX, and the output is going to be hard to integrate with the LRWAN code which is a hybrid of the Semtech stack and HAL using the RTC as a timebase.

The VCOM.C provides some example of how to interact with the USART

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
yjae
Associate II

I see. Thank you.by the way, The source says 'GPIO_InitStructure.Pin = GPIO_PIN_10 | GPIO_PIN_11;'. I set pc10,pc11 as usart4, is this correct?

The pin list is a bit vector, you can use it to describe multiple pins on the given GPIO Bank

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
yjae
Associate II

​thank you friend There is another question. can use dma?(above source)

The L073RZ is capable of using DMA for USART4, the VCOM.C is not illustrative of this, but there might be examples under the HAL trees.

STM32Cube_FW_L0_V1.10.0\Projects\STM32L073RZ-Nucleo\Examples\UART\UART_TwoBoards_ComDMA

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..