Unable to generate components, possibly due to misunderstanding of component type.

118 views
Skip to first unread message

Rawin Pinkoh

unread,
Jun 7, 2021, 10:23:30 PM6/7/21
to F´ Community Group
Hi, I'm Rawin, a satellite engineer from Thailand. I am testing out F' to see if it's capable of our team's project. As a proof of concept and a tool for us to learn the framework, I decided to make a simple prototype involve turning on and off and blink a LED bulb connected to BeagleBone Black. I tried to mimic the GPS component in the tutorial, guessing that it should be similar, minus the serial driver stuff of course. The LED component will receive a command to turn on or off the LED and the text event will print if the light is on or off. However, once I try to generate it, it returns errors. I attached my componentAi.xml and cmake error log.

Based on the error log, I'm guessing that it has to do with me not selecting correct type of components but I'm not sure on how to proceed. I'm wondering if you could ELI5 on how each type of component work as well as helping me to see what I did wrong in the code. I don't have quite a strong background in programming. I pick this task up because it looks interesting and would love to pursue this route in the aerospace industry.
LEDComponentAi.xml
CMakeError.log

Rawin Pinkoh

unread,
Jun 8, 2021, 2:11:11 AM6/8/21
to F´ Community Group
Never mind, I just realized that there are ports specifically made for read/write on GPIO, SPI, I2C and more! For those who are interested, it's in fprime/drv folder. I will probably be using those instead and see if it works on my prototype.

Thanks!

lestarch

unread,
Jun 8, 2021, 2:13:00 AM6/8/21
to F´ Community Group
I see pthread errors in your log.  What OS/platform are you running the compile on?  Windows?  Directly on the beaglebone?

To answer your question:

1. "active" components have threads and message queues. Port calls that arrive in an "async_input" port will be run on the components thread.  Other input ports execute on the caller's thread.
2. "passive" components have no thread.  Their port calls always execute on the caller's thread.  These components cannot use "async_input" ports.
3. "queued" components have no thread but do have queues.  They can handle "async_input" ports, but the queue must be manually dispatched as there is no thread to automatically execute on.

Your choice of "active" is appropriate for the "async_input" ports you have defined. However, since the compiler cannot detect "pthreads" (posix threading library) it cannot compile an active component as threads cannot be used without that library.  This is why I am asking about the OS and platform, to help figure out why pthreads is missing.

-Michael

Rawin Pinkoh

unread,
Jun 8, 2021, 2:24:46 AM6/8/21
to F´ Community Group

Hi Michael
Thanks for the answer. I'm compiling it on Ubuntu (18.04 to be precise). I've never had this error while following Math Components and GPS Tutorial. That why I'm so confused.

lestarch

unread,
Jun 9, 2021, 11:27:14 AM6/9/21
to F´ Community Group
Are you getting any terminal output errors or just those in the CMakeErrors.log?

-Michael 

Rawin Pinkoh

unread,
Jun 9, 2021, 10:25:29 PM6/9/21
to F´ Community Group
Here's the output from the terminal after fprime-util generate. Seem like something's wrong with parsing.

[WARNING] Failed to find settings file: /home/rpk/fprime/LEDTest/settings.ini
[INFO] Generating build directory at: /home/rpk/fprime/LEDTest/build-fprime-automatic-native
[INFO] Using toolchain file None for platform default
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Searching for F prime modules in: /home/rpk/fprime
-- Autocoder constants file: /home/rpk/fprime/config/AcConstants.ini
-- Configuration header directory: /home/rpk/fprime/config
-- Target build platform: Linux
-- Including /home/rpk/fprime/cmake/platform/../platform/Linux.cmake
-- Requiring thread library
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- [VALIDATION] Running: python3;/home/rpk/fprime/cmake/support/validation/pipsetup.py
-- Installation directory: /home/rpk/fprime/LEDTest
-- Adding library: Fw_Buffer
--     Found port: BufferGet in /home/rpk/fprime/Fw/Buffer/BufferGetPortAi.xml
--     Found port: BufferSend in /home/rpk/fprime/Fw/Buffer/BufferSendPortAi.xml
-- Adding library: Fw_Com
--     Found port: Com in /home/rpk/fprime/Fw/Com/ComPortAi.xml
-- Adding library: Fw_Cmd
--     Found port: Cmd in /home/rpk/fprime/Fw/Cmd/CmdPortAi.xml
--     Found port: CmdReg in /home/rpk/fprime/Fw/Cmd/CmdRegPortAi.xml
--     Found port: CmdResponse in /home/rpk/fprime/Fw/Cmd/CmdResponsePortAi.xml
-- Adding library: Fw_Log
--     Found port: Log in /home/rpk/fprime/Fw/Log/LogPortAi.xml
--     Found port: LogText in /home/rpk/fprime/Fw/Log/LogTextPortAi.xml
-- Adding library: Fw_Logger
-- Adding library: Fw_Time
--     Found port: Time in /home/rpk/fprime/Fw/Time/TimePortAi.xml
-- Adding library: Fw_Tlm
--     Found port: Tlm in /home/rpk/fprime/Fw/Tlm/TlmPortAi.xml
-- Adding library: Fw_Prm
--     Found port: PrmGet in /home/rpk/fprime/Fw/Prm/PrmGetPortAi.xml
--     Found port: PrmSet in /home/rpk/fprime/Fw/Prm/PrmSetPortAi.xml
-- Adding library: Fw_Cfg
-- Adding library: Fw_Comp
-- Adding library: Fw_CompQueued
-- Adding library: Fw_Obj
-- Adding library: Fw_Port
-- Adding library: Fw_Types
-- Adding library: Fw_FilePacket
-- Adding library: Fw_SerializableFile
-- Adding library: Fw_Test
-- Adding library: Svc_Cycle
--     Found port: Cycle in /home/rpk/fprime/Svc/Cycle/CyclePortAi.xml
-- Adding library: Svc_Fatal
--     Found port: FatalEvent in /home/rpk/fprime/Svc/Fatal/FatalEventPortAi.xml
-- Adding library: Svc_Ping
--     Found port: Ping in /home/rpk/fprime/Svc/Ping/PingPortAi.xml
-- Adding library: Svc_PolyIf
--     Found port: Poly in /home/rpk/fprime/Svc/PolyIf/PolyPortAi.xml
-- Adding library: Svc_Sched
--     Found port: Sched in /home/rpk/fprime/Svc/Sched/SchedPortAi.xml
-- Adding library: Svc_Seq
--     Found port: CmdSeqIn in /home/rpk/fprime/Svc/Seq/CmdSeqInPortAi.xml
-- Adding library: Svc_WatchDog
--     Found port: WatchDog in /home/rpk/fprime/Svc/WatchDog/WatchDogPortAi.xml
-- Adding library: Svc_ActiveLogger
--     Found component: ActiveLogger in /home/rpk/fprime/Svc/ActiveLogger/ActiveLoggerComponentAi.xml
-- Adding library: Svc_ActiveTextLogger
--     Found component: ActiveTextLogger in /home/rpk/fprime/Svc/ActiveTextLogger/ActiveTextLoggerComponentAi.xml
-- Adding library: Svc_ActiveRateGroup
--     Found component: ActiveRateGroup in /home/rpk/fprime/Svc/ActiveRateGroup/ActiveRateGroupComponentAi.xml
-- Adding library: Svc_AssertFatalAdapter
--     Found component: AssertFatalAdapter in /home/rpk/fprime/Svc/AssertFatalAdapter/AssertFatalAdapterComponentAi.xml
-- Adding library: Svc_BufferManager
--     Found component: BufferManager in /home/rpk/fprime/Svc/BufferManager/BufferManagerComponentAi.xml
-- Adding library: Svc_BufferLogger
--     Found component: BufferLogger in /home/rpk/fprime/Svc/BufferLogger/BufferLoggerComponentAi.xml
-- Adding library: Svc_ComLogger
--     Found component: ComLogger in /home/rpk/fprime/Svc/ComLogger/ComLoggerComponentAi.xml
-- Adding library: Svc_ComSplitter
--     Found component: ComSplitter in /home/rpk/fprime/Svc/ComSplitter/ComSplitterComponentAi.xml
-- Adding library: Svc_CmdDispatcher
--     Found component: CommandDispatcher in /home/rpk/fprime/Svc/CmdDispatcher/CommandDispatcherComponentAi.xml
-- Adding library: Svc_CmdSequencer
--     Found component: CmdSequencer in /home/rpk/fprime/Svc/CmdSequencer/CmdSequencerComponentAi.xml
-- Adding library: Svc_Deframer
--     Found component: Deframer in /home/rpk/fprime/Svc/Deframer/DeframerComponentAi.xml
-- Adding library: Svc_FatalHandler
--     Found component: FatalHandler in /home/rpk/fprime/Svc/FatalHandler/FatalHandlerComponentAi.xml
-- Adding library: Svc_FileDownlink
--     Found enum: SendFileStatus in /home/rpk/fprime/Svc/FileDownlink/SendFileStatusEnumAi.xml
--     Found serializable: SendFileResponse in /home/rpk/fprime/Svc/FileDownlink/SendFileResponseSerializableAi.xml
--     Found port: SendFileRequest in /home/rpk/fprime/Svc/FileDownlink/SendFileRequestPortAi.xml
--     Found port: SendFileComplete in /home/rpk/fprime/Svc/FileDownlink/SendFileCompletePortAi.xml
--     Found component: FileDownlink in /home/rpk/fprime/Svc/FileDownlink/FileDownlinkComponentAi.xml
-- Adding library: Svc_FileManager
--     Found component: FileManager in /home/rpk/fprime/Svc/FileManager/FileManagerComponentAi.xml
-- Adding library: Svc_FileUplink
--     Found component: FileUplink in /home/rpk/fprime/Svc/FileUplink/FileUplinkComponentAi.xml
-- Adding library: Svc_GenericHub
--     Found component: GenericHub in /home/rpk/fprime/Svc/GenericHub/GenericHubComponentAi.xml
-- Adding library: Svc_GenericRepeater
--     Found component: GenericRepeater in /home/rpk/fprime/Svc/GenericRepeater/GenericRepeaterComponentAi.xml
-- Adding library: Svc_GroundInterface
--     Found component: GroundInterface in /home/rpk/fprime/Svc/GroundInterface/GroundInterfaceComponentAi.xml
-- Adding library: Svc_Framer
--     Found component: Framer in /home/rpk/fprime/Svc/Framer/FramerComponentAi.xml
-- Adding library: Svc_FramingProtocol
-- Adding library: Svc_Health
--     Found component: Health in /home/rpk/fprime/Svc/Health/HealthComponentAi.xml
-- Adding library: Svc_LinuxTime
-- Adding library: Svc_LinuxTimer
--     Found component: LinuxTimer in /home/rpk/fprime/Svc/LinuxTimer/LinuxTimerComponentAi.xml
-- Adding library: Svc_PassiveConsoleTextLogger
--     Found component: PassiveTextLogger in /home/rpk/fprime/Svc/PassiveConsoleTextLogger/PassiveTextLoggerComponentAi.xml
-- Adding library: Svc_PolyDb
--     Found component: PolyDb in /home/rpk/fprime/Svc/PolyDb/PolyDbComponentAi.xml
-- Adding library: Svc_PrmDb
--     Found component: PrmDb in /home/rpk/fprime/Svc/PrmDb/PrmDbComponentAi.xml
-- Adding library: Svc_RateGroupDriver
--     Found component: RateGroupDriver in /home/rpk/fprime/Svc/RateGroupDriver/RateGroupDriverComponentAi.xml
-- Adding library: Svc_StaticMemory
--     Found component: StaticMemory in /home/rpk/fprime/Svc/StaticMemory/StaticMemoryComponentAi.xml
-- Adding library: Svc_Time
--     Found component: Time in /home/rpk/fprime/Svc/Time/TimeComponentAi.xml
-- Adding library: Svc_TlmChan
--     Found component: TlmChan in /home/rpk/fprime/Svc/TlmChan/TlmChanComponentAi.xml
-- Adding library: Os
-- Adding library: Drv_DataTypes
--     Found port: DataBuffer in /home/rpk/fprime/Drv/DataTypes/DataBufferPortAi.xml
-- Adding library: Drv_GpioDriverPorts
--     Found port: GpioWrite in /home/rpk/fprime/Drv/GpioDriverPorts/GpioWritePortAi.xml
--     Found port: GpioRead in /home/rpk/fprime/Drv/GpioDriverPorts/GpioReadPortAi.xml
-- Adding library: Drv_SerialDriverPorts
--     Found port: SerialRead in /home/rpk/fprime/Drv/SerialDriverPorts/SerialReadPortAi.xml
--     Found port: SerialWrite in /home/rpk/fprime/Drv/SerialDriverPorts/SerialWritePortAi.xml
-- Adding library: Drv_SpiDriverPorts
--     Found port: SpiReadWrite in /home/rpk/fprime/Drv/SpiDriverPorts/SpiReadWritePortAi.xml
-- Adding library: Drv_I2cDriverPorts
--     Found port: I2c in /home/rpk/fprime/Drv/I2cDriverPorts/I2cPortAi.xml
--     Found port: I2cWriteRead in /home/rpk/fprime/Drv/I2cDriverPorts/I2cWriteReadPortAi.xml
--     Found enum: I2cStatus in /home/rpk/fprime/Drv/I2cDriverPorts/I2cStatusEnumAi.xml
-- Adding library: Drv_BlockDriver
--     Found component: BlockDriver in /home/rpk/fprime/Drv/BlockDriver/BlockDriverComponentAi.xml
-- Adding library: Drv_ByteStreamDriverModel
--     Found port: ByteStreamRecv in /home/rpk/fprime/Drv/ByteStreamDriverModel/ByteStreamRecvPortAi.xml
--     Found port: ByteStreamSend in /home/rpk/fprime/Drv/ByteStreamDriverModel/ByteStreamSendPortAi.xml
--     Found port: ByteStreamPoll in /home/rpk/fprime/Drv/ByteStreamDriverModel/ByteStreamPollPortAi.xml
--     Found component: ByteStreamDriver in /home/rpk/fprime/Drv/ByteStreamDriverModel/ByteStreamDriverComponentAi.xml
-- Adding library: Drv_LinuxGpioDriver
--     Found component: LinuxGpioDriver in /home/rpk/fprime/Drv/LinuxGpioDriver/LinuxGpioDriverComponentAi.xml
-- Adding library: Drv_LinuxSerialDriver
--     Found component: LinuxSerialDriver in /home/rpk/fprime/Drv/LinuxSerialDriver/LinuxSerialDriverComponentAi.xml
-- Adding library: Drv_LinuxSpiDriver
--     Found component: LinuxSpiDriver in /home/rpk/fprime/Drv/LinuxSpiDriver/LinuxSpiDriverComponentAi.xml
-- Adding library: Drv_LinuxI2cDriver
--     Found component: LinuxI2cDriver in /home/rpk/fprime/Drv/LinuxI2cDriver/LinuxI2cDriverComponentAi.xml
-- Adding library: Drv_Ip
-- Adding library: Drv_TcpClient
--     Found component: ByteStreamDriver in /home/rpk/fprime/Drv/ByteStreamDriverModel/ByteStreamDriverComponentAi.xml
-- Adding library: Drv_TcpServer
--     Found component: ByteStreamDriver in /home/rpk/fprime/Drv/ByteStreamDriverModel/ByteStreamDriverComponentAi.xml
-- Adding library: Drv_Udp
--     Found component: ByteStreamDriver in /home/rpk/fprime/Drv/ByteStreamDriverModel/ByteStreamDriverComponentAi.xml
-- Adding library: Drv_SocketIpDriver
--     Found component: SocketIpDriver in /home/rpk/fprime/Drv/SocketIpDriver/SocketIpDriverComponentAi.xml
-- Adding library: CFDP_Checksum
-- Adding library: Utils
-- Adding library: Utils_Hash
-- Adding library: Utils_Types
-- Adding library: LEDTest_LED
Traceback (most recent call last):
  File "/home/rpk/fprime/cmake/support/parser/ai_parser.py", line 207, in <module>
    main()
  File "/home/rpk/fprime/cmake/support/parser/ai_parser.py", line 96, in main
    tree = xml.etree.ElementTree.parse(sys.argv[1])
  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 1196, in parse
    tree.parse(source, parser)
  File "/usr/lib/python3.6/xml/etree/ElementTree.py", line 597, in parse
    self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 48, column 31
CMake Error at /home/rpk/fprime/cmake/support/Utils.cmake:112 (message):
-- Configuring incomplete, errors occurred!
  Failed to parse /home/rpk/fprime/LEDTest/LED/LEDComponentAi.xml.  1
See also "/home/rpk/fprime/LEDTest/build-fprime-automatic-native/CMakeFiles/CMakeOutput.log".
Call Stack (most recent call first):
See also "/home/rpk/fprime/LEDTest/build-fprime-automatic-native/CMakeFiles/CMakeError.log".
  /home/rpk/fprime/cmake/support/Module.cmake:32 (fprime_ai_info)
  /home/rpk/fprime/cmake/support/Module.cmake:88 (generic_autocoder)
  /home/rpk/fprime/cmake/support/Module.cmake:149 (generate_module)
  /home/rpk/fprime/cmake/API.cmake:182 (generate_library)
  LED/CMakeLists.txt:11 (register_fprime_module)


[ERROR] CMake erred with return code 1. Partial build cache remains. Run purge to clean-up.

I have verified that pthread is installed and pthread_create function exists. I read somewhere that the pthread_create error could be a red herring and the actual source of error is somewhere else that has nothing to do with it.

Saba Janamian

unread,
Jun 10, 2021, 12:35:30 PM6/10/21
to Rawin Pinkoh, F´ Community Group
On line 48 of your AI.xml you are missing quotation around the name:
Change this:
<enum name=SwitchOperation>
to 
Change this:
<enum name="SwitchOperation">

If you look at the output of the CMake it points you toward the exact line where the issue exist.

xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 48, column 31

Thank you,

Saba



--
You received this message because you are subscribed to the Google Groups "F´ Community Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fprime-communi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fprime-community/74dafd8a-988b-45af-b4a0-90e90eb0d718n%40googlegroups.com.

Rawin Pinkoh

unread,
Jun 10, 2021, 9:28:35 PM6/10/21
to F´ Community Group
Yep, that solves the problem. I knew it was something small but never thought I would be this dumb lol. Thanks Saba!
Reply all
Reply to author
Forward
0 new messages