Legato - custom kernel module (path to mdef)

Hi,

v5.3.1 of Developer Studio is a welcome tool for legato and WP76xx integration. However the path definition relationship between the sdef (where i am defining a custom kernel module) and the parsing of the sdef file to determine the locations of the mdef files is not very clear. Help regarding the required changes to the project properties in order for the mksys to correctly find my custom mdef file, from the defined custom kernel module in sdef, would be greatly appreciated. It appears that simply adding a custom kernel module line e.g. “$CURDIR/linux_kernel_modules/CyUSBSerial” to the sdef file does not update the the required dependency paths.

Regards,
Ben

which sdef file are you modifying?

mangOH.sdef

Created new MangOH project through File menu, for a green dev brd (which DevStudio retrieves from the git repo). With a little manipulation of the build variables and environment variable, I have it building great. Commenting out the heartbeatGreen line in the mangoh.sdef, rebuilding and updating the target - correctly removes the app from the WP. However adding a new folder under the linux_kernel_modules folder and creating an appropriate mdef file for the library, then adding the appropriate line to the mangOH.sdef yields the following, and I can’t quite pinpoint which paths to modify in DevStudio in order for the mdef to be found.

make -C Target_Legato_Debug all
make: Entering directory ‘/home/mangoh/devstudio-5.3.1-linux64/workspace/git/mangOH/Target_Legato_Debug’
cd …;mksys -t wp76xx -o Target_Legato_Debug -w Target_Legato_Debug --output-dir=build/update_files/green -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/airVantage/legacy” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/logDaemon” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/supervisor” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/portService” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/secureStorage” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/airVantage” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/wifi” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/watchdog” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/atServices” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/positioning” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/modemServices” -s “samples/BsecTest” -s “samples/RelayControl” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/test/watchdogChain” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/platformServices/airVantageConnector” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/airVantage” -s “apps/BatteryService” -s “apps/MuxControl/muxCtrlService” -s “samples/Demos/ShakeNWake” -s “samples/tutorials/mangOH_Red/adc/NoiseSensor” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/platformServices/airVantage” -s “samples/IioDeviceList” -s “apps/Heartbeat” -s “apps/GpioExpander/gpioExpanderDemo” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/portService” -s “samples/Demos/LegatoWebsocketd” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/modemServices/platformAdaptor/default” -s “apps/DataHub-Buzzer” -s “samples/Demos/KillSwitch” -s “samples/tutorials/voice” -s “samples/Demos/GpsPublish” -s “samples/BatteryClient” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/audio/platformAdaptor/default” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/3rdParty” -s “apps/DataRouter” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/fwupdate/platformAdaptor/default” -s “apps/YellowOnBoardActuators/components/led” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/dataConnectionService” -s “samples/tutorials/mangOH_Green/gpio/TimerLed” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/airVantage/platformAdaptor/default” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/proprietary/qmiAirVantage/bin/wp76xx” -s “apps/GpioExpander/gpioExpanderService” -s “apps/LocationTriangulation” -s “samples/tutorials/mangOH_Red/i2c/BatteryChargerReading” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/positioning/platformAdaptor/default” -s “samples/tutorials/mangOH_Green/adc/NoiseSensor” -s “apps/OpenWeatherMapAmbientTemperature” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/devMode” -s “samples/Demos/WiredSensor” -s “apps/MuxControl/tools” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/modemServices” -s “apps/RedSensorToCloud” -s “samples/Demos/SensorToAirVantage” -s “samples/tutorials/mangOH_Green/gpio/Cf3GpioControl” -s “samples/tutorials/mangOH_Red/gpio/TimerLed” -s “components” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/dataConnectionService/platformAdaptor/default” -s “apps/DataPushTest” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/modules/WiFi/apps/tools/wifi” -s “apps/YellowSensorToCloud/components” -s “apps/LedService” -s “samples/tutorials/mangOH_Green/gpio/TouchSensor” -s “samples/tutorials/mangOH_Green/i2c/BatteryChargerReading” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/positioning” -s “apps/Mcp9700aTemperatureSensor” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/secStore” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/proprietary/atQmiLinker/bin/wp76xx” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/uartMode/platformAdaptor/default” -s “apps/SocialService” -s “apps/DataRouter/drTool” -s “samples/tutorials/mangOH_Red/gpio/Cf3GpioControl” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/tools” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/proprietary/atAirVantage/bin/wp76xx” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/modules/WiFi/service” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/fwupdate” -s “samples/Demos/MobileAssetTracker” -s “samples/tutorials/mangOH_Red/gpio/TouchSensor” -s “samples/tutorials/developerDay2016/components” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/secStore/platformAdaptor/default” -s “apps/YellowSensorToCloud/components/sensors” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/platformServices/mqttClient” -s “samples/Demos/BleSensorInterface” -s “apps/ArduinoBridge” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/atServices” -s “apps/Bme680EnvironmentalSensor” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/uartMode” -s “apps/MqttClient” -s “samples/tutorials/mangOH_Red/AirVantage/ButtonToAirVantage” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/platformServices” -C -g -X -g -L -g mangOH.sdef
** ERROR:
/home/mangoh/devstudio-5.3.1-linux64/workspace/git/mangOH/mangOH.sdef:169:4: error: Can’t find definition file (.mdef) for module specification ‘/home/mangoh/devstudio-5.3.1-linux64/workspace/git/mangOH/linux_kernel_modules/CyUSBSerial’.
Makefile:37: recipe for target ‘target’ failed
make: Leaving directory ‘/home/mangoh/devstudio-5.3.1-linux64/workspace/git/mangOH/Target_Legato_Debug’
note: Looked in the following places:
‘samples/BsecTest’
‘samples/RelayControl’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/test/watchdogChain’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/platformServices/airVantageConnector’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/airVantage’
‘apps/BatteryService’
‘apps/MuxControl/muxCtrlService’
‘samples/Demos/ShakeNWake’
‘samples/tutorials/mangOH_Red/adc/NoiseSensor’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/platformServices/airVantage’
‘samples/IioDeviceList’
‘apps/Heartbeat’
‘apps/GpioExpander/gpioExpanderDemo’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/portService’
‘samples/Demos/LegatoWebsocketd’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/modemServices/platformAdaptor/default’
‘apps/DataHub-Buzzer’
‘samples/Demos/KillSwitch’
‘samples/tutorials/voice’
‘samples/Demos/GpsPublish’
‘samples/BatteryClient’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/audio/platformAdaptor/default’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/3rdParty’
‘apps/DataRouter’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/fwupdate/platformAdaptor/default’
‘apps/YellowOnBoardActuators/components/led’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/dataConnectionService’
‘samples/tutorials/mangOH_Green/gpio/TimerLed’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/airVantage/platformAdaptor/default’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/proprietary/qmiAirVantage/bin/wp76xx’
‘apps/GpioExpander/gpioExpanderService’
‘apps/LocationTriangulation’
‘samples/tutorials/mangOH_Red/i2c/BatteryChargerReading’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/positioning/platformAdaptor/default’
‘samples/tutorials/mangOH_Green/adc/NoiseSensor’
‘apps/OpenWeatherMapAmbientTemperature’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/devMode’
‘samples/Demos/WiredSensor’
‘apps/MuxControl/tools’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/modemServices’
‘apps/RedSensorToCloud’
‘samples/Demos/SensorToAirVantage’
‘samples/tutorials/mangOH_Green/gpio/Cf3GpioControl’
‘samples/tutorials/mangOH_Red/gpio/TimerLed’
‘components’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/dataConnectionService/platformAdaptor/default’
‘apps/DataPushTest’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/modules/WiFi/apps/tools/wifi’
‘apps/YellowSensorToCloud/components’
‘apps/LedService’
‘samples/tutorials/mangOH_Green/gpio/TouchSensor’
‘samples/tutorials/mangOH_Green/i2c/BatteryChargerReading’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/positioning’
‘apps/Mcp9700aTemperatureSensor’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/secStore’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/proprietary/atQmiLinker/bin/wp76xx’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/uartMode/platformAdaptor/default’
‘apps/SocialService’
‘apps/DataRouter/drTool’
‘samples/tutorials/mangOH_Red/gpio/Cf3GpioControl’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/tools’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/proprietary/atAirVantage/bin/wp76xx’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/modules/WiFi/service’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/fwupdate’
‘samples/Demos/MobileAssetTracker’
‘samples/tutorials/mangOH_Red/gpio/TouchSensor’
‘samples/tutorials/developerDay2016/components’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/secStore/platformAdaptor/default’
‘apps/YellowSensorToCloud/components/sensors’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/platformServices/mqttClient’
‘samples/Demos/BleSensorInterface’
‘apps/ArduinoBridge’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/atServices’
‘apps/Bme680EnvironmentalSensor’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/uartMode’
‘apps/MqttClient’
‘samples/tutorials/mangOH_Red/AirVantage/ButtonToAirVantage’
‘/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/platformServices’
‘.’

make: *** [target] Error 1

21:40:46 Build Finished (took 2s.441ms)

how did you modify mangOH.sdef ?
Did you add something like:
$MANGOH_ROOT/linux_kernel_modules/CyUSBSerial/CyUSBSerial

mktool_args.txt (6.9 KB)
mktool_environment.txt (4.7 KB)
Yes. Have sorted, but now path to linux includes is not working. Surely I don’t have to put in the path to the linux header files in the mdef (cflags)…

make -C Target_Legato_Debug all
make: Entering directory ‘/home/mangoh/devstudio-5.3.1-linux64/workspace/git/mangOH/Target_Legato_Debug’
cd …;mksys -t wp76xx -o Target_Legato_Debug -w Target_Legato_Debug --output-dir=build/update_files/green -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/airVantage/legacy” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/logDaemon” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/supervisor” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/portService” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/secureStorage” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/airVantage” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/wifi” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/watchdog” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/atServices” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/positioning” -i “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/interfaces/modemServices” -s “samples/BsecTest” -s “samples/RelayControl” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/test/watchdogChain” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/platformServices/airVantageConnector” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/airVantage” -s “apps/BatteryService” -s “apps/MuxControl/muxCtrlService” -s “samples/Demos/ShakeNWake” -s “samples/tutorials/mangOH_Red/adc/NoiseSensor” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/platformServices/airVantage” -s “samples/IioDeviceList” -s “apps/Heartbeat” -s “apps/GpioExpander/gpioExpanderDemo” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/portService” -s “samples/Demos/LegatoWebsocketd” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/modemServices/platformAdaptor/default” -s “apps/DataHub-Buzzer” -s “samples/Demos/KillSwitch” -s “samples/tutorials/voice” -s “samples/Demos/GpsPublish” -s “samples/BatteryClient” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/audio/platformAdaptor/default” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/3rdParty” -s “apps/DataRouter” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/fwupdate/platformAdaptor/default” -s “apps/YellowOnBoardActuators/components/led” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/dataConnectionService” -s “samples/tutorials/mangOH_Green/gpio/TimerLed” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/airVantage/platformAdaptor/default” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/proprietary/qmiAirVantage/bin/wp76xx” -s “apps/GpioExpander/gpioExpanderService” -s “apps/LocationTriangulation” -s “samples/tutorials/mangOH_Red/i2c/BatteryChargerReading” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/positioning/platformAdaptor/default” -s “samples/tutorials/mangOH_Green/adc/NoiseSensor” -s “apps/OpenWeatherMapAmbientTemperature” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/devMode” -s “samples/Demos/WiredSensor” -s “apps/MuxControl/tools” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/modemServices” -s “apps/RedSensorToCloud” -s “samples/Demos/SensorToAirVantage” -s “samples/tutorials/mangOH_Green/gpio/Cf3GpioControl” -s “samples/tutorials/mangOH_Red/gpio/TimerLed” -s “components” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/dataConnectionService/platformAdaptor/default” -s “apps/DataPushTest” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/modules/WiFi/apps/tools/wifi” -s “apps/YellowSensorToCloud/components” -s “apps/LedService” -s “samples/tutorials/mangOH_Green/gpio/TouchSensor” -s “samples/tutorials/mangOH_Green/i2c/BatteryChargerReading” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/positioning” -s “apps/Mcp9700aTemperatureSensor” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/secStore” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/proprietary/atQmiLinker/bin/wp76xx” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/uartMode/platformAdaptor/default” -s “apps/SocialService” -s “apps/DataRouter/drTool” -s “samples/tutorials/mangOH_Red/gpio/Cf3GpioControl” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/tools” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/proprietary/atAirVantage/bin/wp76xx” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/modules/WiFi/service” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/fwupdate” -s “samples/Demos/MobileAssetTracker” -s “samples/tutorials/mangOH_Red/gpio/TouchSensor” -s “samples/tutorials/developerDay2016/components” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/secStore/platformAdaptor/default” -s “apps/YellowSensorToCloud/components/sensors” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/platformServices/mqttClient” -s “samples/Demos/BleSensorInterface” -s “apps/ArduinoBridge” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/atServices” -s “apps/Bme680EnvironmentalSensor” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/components/uartMode” -s “apps/MqttClient” -s “samples/tutorials/mangOH_Red/AirVantage/ButtonToAirVantage” -s “/home/mangoh/legato/packages/legato.framework.18.10.3.wp76xx-201903041257/resources/legato/apps/platformServices” -C -g -X -g -L -g mangOH.sdef
[1/1101] Build kernel driver module
FAILED: /home/mangoh/devstudio-5.3.1-linux64/workspace/git/mangOH/Target_Legato_Debug/modules/CyUSBSerial/CyUSBSerial.ko
make -C /home/mangoh/devstudio-5.3.1-linux64/workspace/git/mangOH/Target_Legato_Debug/modules/CyUSBSerial
make[1]: Entering directory ‘/home/mangoh/devstudio-5.3.1-linux64/workspace/git/mangOH/Target_Legato_Debug/modules/CyUSBSerial’
make -C /home/mangoh/legato/packages/legato.toolchain.0.25.2.01.SWI9X07Y_02250201-wp76xx-native-x86_64-201903041238/resources/native/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel M=/home/mangoh/devstudio-5.3.1-linux64/workspace/git/mangOH/Target_Legato_Debug/modules/CyUSBSerial modules
make[2]: Entering directory ‘/home/mangoh/legato/packages/legato.toolchain.0.25.2.01.SWI9X07Y_02250201-wp76xx-native-x86_64-201903041238/resources/native/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel’
CC [M] /home/mangoh/devstudio-5.3.1-linux64/workspace/git/mangOH/Target_Legato_Debug/modules/CyUSBSerial/cyusb.o
In file included from /home/mangoh/devstudio-5.3.1-linux64/workspace/git/mangOH/linux_kernel_modules/CyUSBSerial/cyusb.c:20:0:
/home/mangoh/devstudio-5.3.1-linux64/workspace/git/mangOH/linux_kernel_modules/CyUSBSerial/CyUSBCommon.h:20:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
scripts/Makefile.build:257: recipe for target ‘/home/mangoh/devstudio-5.3.1-linux64/workspace/git/mangOH/Target_Legato_Debug/modules/CyUSBSerial/cyusb.o’ failed

I don’t see any linux_kernel_modules having this include in the .c file.
Maybe you can try to comment this line and see if it can be compiled.

There are quite a few modules that use linux kernel header files.
for the mangOH, the bmi160 module - bmi60_core.c has <linux/module.h>…
cp2130 - spi-cp2130.h has <linux/spi/spi.h>

These all compile fine.

I did modify my header file to <linux/…/include/stdio.h> which worked (as I assumed ‘linux’ was the path to the linux source code: which indeed it was), however other header files referenced by this file[stdio.h] cannot be found, so it must be a global path missing in the make command line it think.

in your mdef file, you need to add:


cflags:
{
“-I/opt/swi/y22-ext/sysroots/armv7a-neon-poky-linux-gnueabi/usr/include/”

}


I have decided to build a basic kmod (ktest_module.c in the link below) and try to compile it and the compiler still can’t find kernel support root directory. I have added B_KDIR (/home/mangoh/legato/packages/legato.toolchain.0.25.2.01.SWI9X07Y_02250201-wp76xx-native-x86_64-201903041238/resources/native/sysroots/armv7a-neon-poky-linux-gnueabi/usr/src/kernel) to the environ in DevStudio thinking this may be the cause (after reading the old way to build o-k-m @ Old out of tree module procedure). But still no luck.

image

The error on compiling is…
ktest_module.c:15:42: error: ‘VERSION’ undeclared (first use in this function)
** printk(KERN_INFO “Driver version %s\n”, VERSION);**

Any thoughts?

where is the VERSION defined?

Apologies, have it working now.
Now to expand it to slow incorporate items from the CyUSBSerial driver.