We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
how to display a string from stm32l053r8 nucleo using cube libraries in keilv5 (via USB to virtual com port) **************************************** code:
if( HAL_ADC_Start(&hadc) != HAL_OK) return 0; if (HAL_ADC_Start_DMA(&hadc, (uint32_t*)ADC1ConvertedValues, 2048) != HAL_OK) // return 0; temp=HAL_ADC_GetValue ( &hadc );
need to display the temp value through usb in virtual com port (teraterm)
Configure the USART and pins, PA2 and PA3 on the Nucleo's as I recall. Check the manual for the pins and USART# specific to the L0 part.
If you want to use printf(), then you'll need to add semi-hosting code to redirect/retarget the STDIO input and output functions to code you provide that talks to the USART.
if you can use sprintf(), you can create a string, and then add routines to send the string a character at a time out the USART.
it would be very delightful if you could tell me about " semi-hosting code to redirect/retarget the STDIO input and output functions to code you provide that talks to the USART."
Try putting "semi hosting" into the 'Search' box - it's all in the ARM Tool manuals...
www.keil.com/search.asp
http://www.keil.com/support/man/docs/gsac/gsac_retargetcortex.htm
my.st.com/.../Flat.aspx