-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
output printf() messages to the serial terminal on STM32 #3
output printf() messages to the serial terminal on STM32 #3
Conversation
Enabling this macro can output printf() to the serial terminal (via USART3). Note that linking printf() may increase the file size. This macro is disabled by default.
Reported error log: make all arm-none-eabi-g++ "../rtps/src/messages/MessageReceiver.cpp" -mcpu=cortex-m7 -std=gnu++14 -g3 '-D__weak=__attribute__((weak))' '-D__packed=__attribute__((__packed__))' -DUSE_HAL_DRIVER -DSTM32F767xx '-DEMBEDDEDRTPS_CONFIG_STM32NF767ZI=1' -c -I../Inc -I../Middlewares/Third_Party/LwIP/system -I../Drivers/STM32F7xx_HAL_Driver/Inc -I../Drivers/STM32F7xx_HAL_Driver/Inc/Legacy -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1 -I../Middlewares/Third_Party/LwIP/src/include/netif/ppp -I../Drivers/CMSIS/Device/ST/STM32F7xx/Include -I../Middlewares/Third_Party/LwIP/src/include/lwip/apps -I../Middlewares/Third_Party/LwIP/src/include/lwip/priv -I../Middlewares/Third_Party/LwIP/src/include/lwip/prot -I../Middlewares/Third_Party/LwIP/src/include/netif -I../Middlewares/Third_Party/LwIP/src/include/posix -I../Middlewares/Third_Party/LwIP/src/include/posix/sys -I../Middlewares/Third_Party/LwIP/system/arch -I../Drivers/CMSIS/Include -I../Middlewares/Third_Party/LwIP/src/include -I../Middlewares/Third_Party/LwIP/src/include/lwip -I/Users/davidk/Documents/Embedded/embedded-rtps-stm32/rtps/include -I"/~~/stm32/rtps/include" -I"/~~/stm32/rtps/thirdparty/Micro-CDR/include" -Og -ffunction-sections -fno-exceptions -fno-rtti -fno-use-cxa-atexit -Wall -fexceptions -fstack-usage -std=gnu++11 -fstack-usage -MMD -MP -MF"rtps/src/messages/MessageReceiver.d" -MT"rtps/src/messages/MessageReceiver.o" --specs=nano.specs -mfpu=fpv5-d16 -mfloat-abi=hard -mthumb -o "rtps/src/messages/MessageReceiver.o" ../rtps/src/messages/MessageReceiver.cpp: In member function 'bool rtps::MessageReceiver::processSubmessage(rtps::MessageProcessingInfo&, const rtps::SubmessageHeader&)': ../rtps/src/messages/MessageReceiver.cpp:133:116: error: base operand of '->' has non-pointer type 'const rtps::SubmessageHeader' printf("Submessage of type %u currently not supported. Skipping..\n", static_cast<uint8_t>(submsgHeader->submessageId)); ^~ ../rtps/src/messages/MessageReceiver.cpp: In member function 'bool rtps::MessageReceiver::processDataSubmessage(rtps::MessageProcessingInfo&)': ../rtps/src/messages/MessageReceiver.cpp:161:33: error: base operand of '->' has non-pointer type 'rtps::SubmessageData' printEntityId(dataSubmsg->readerId); ^~ make: *** [rtps/src/messages/subdir.mk:21: rtps/src/messages/MessageReceiver.o] Error 1 "make all" terminated with exit code 2. Build might be incomplete. 17:55:22 Build Failed. 3 errors, 0 warnings. (took 597ms)
Woops,,, some conflicts have happened,,, |
I could have been solved conflicts. All conflicts were caused by clang-format check. |
Hi @takasehideki, sorry for coming back so late to this pull request, for some reason it didn't catch my attention. Unfortunately there are some conflicts now. Is there something still relevant here that we should consider integrating into master? I think I fixed the verbosity bugs independently. Regarding printing: I would like to avoid having controller-specific defines in this repository, as it should be agnostic to a particular controller. Maybe we can isolate the printing part into separate functions that are only declared but not defined, or declare them as weakly linked, so it is easy to override them. Best regards |
Hi @akampmann , thank you for the reply. |
Hi, the issues with different verbosity levels should be fixed. I will close this PR then. I still have to update the embeddedRTPS commit that the STM32 example is pointing to. I haven't had a chance to see if the latest changes still compile/run for the STM32 (have tried on ARM R5 and Infineon Aurix). At least there are some updates to the config that have to be added. Have you had a chance to try the latest commit on STM32? I will probably not have a chance to do so for a few weeks. |
OK, I closed this PR. |
Yes, I'm watching your great activity. I don't have much time, but I would like to try to update the example for STM32. These are for older versions of embeddedRTPS, but we would be grateful if you could consider merging before I will try the update. |
I merged those those PRs just now. Thank you for your contribution! I stumbled upon your talk at ROSCON Japan and https://github.com/mROS-base/mros2 I think this is very cool, I'm curious to hear more about it. Are there plans to translate the slides to english? |
Thank you for merging our works to your repository! And more, thank you so much for finding out our activity!! |
STM32_PRINTF_SERIAL
macroMy modification to
include/rtps/entities/StatefulWriter.tpp
(be3c5e2) may be the discussable point.The original code uses
log()
to output the messages. I guess the implementation oflog()
is in progress. I didn't decide how to fix it, so I simply replacelog()
to printf() whenSTM32_PRINTF_SERIAL
is defined.NOTE:
My branch was created from dc5e510, which is referred from embeddedRTPS-STM32 as the submodule. 7 commits have happened from dc5e510 to this repository.
https://github.com/embedded-software-laboratory/embeddedRTPS/commits/master
My suggestion is the submodule of embeddedRTPS-STM32 should follow the latest commit of this repository.
If you agree with my suggestion, I will add this work in the following PR.
embedded-software-laboratory/embeddedRTPS-STM32#9