cancel
Showing results for 
Search instead for 
Did you mean: 

Run STM32CubeMX in headless mode in a Docker container in Jenkins

kiran_g
Visitor

Hi All,

I am working on setting up a pipeline on Jenkins for building the STM32 platform-based projects. A .ioc file is used to generate the project using the STM32CubeMX command, which is run in a Docker container (from a docker image I built based on ubuntu) in the pipeline script. Here's the command used to invoke STM32CubeMX: 

 

java -jar <path_to_CubeMX>/STM32CubeMX -q <scriptfile>

 

Everything works fine when I use the same image and run a container on my local machine and execute the command inside the container; however, when I pull the image and execute it inside the Docker container in my pipeline using the

 

docker.image(DOCKER_IMAGE).inside(){
---cmd---
}

 

I see the following error in the Jenkins log file as shown below:

 

2024-07-12 11:31:08,156 [ERROR] ProjectBuilder:2169 - 
java.io.IOException: Function not implemented
	at sun.nio.ch.FileChannelImpl.transferFrom0(Native Method) ~[?:?]
	at sun.nio.ch.FileChannelImpl.transferFromDirectlyInternal(FileChannelImpl.java:804) ~[?:?]
	at sun.nio.ch.FileChannelImpl.transferFromDirectly(FileChannelImpl.java:833) ~[?:?]
	at sun.nio.ch.FileChannelImpl.transferFrom(FileChannelImpl.java:935) ~[?:?]
	at org.apache.commons.io.FileUtils.doCopyFile(FileUtils.java:1147) ~[STM32CubeMX:?]
	at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1091) ~[STM32CubeMX:?]
	at org.apache.commons.io.FileUtils.copyFile(FileUtils.java:1038) ~[STM32CubeMX:?]
	at com.st.microxplorer.codegenerator.CodeEngine.genCode(CodeEngine.java:287) ~[STM32CubeMX:?]
	at com.st.microxplorer.codegenerator.CodeGenerator.generateOutputCode(CodeGenerator.java:5818) ~[STM32CubeMX:?]
	at com.st.microxplorer.codegenerator.CodeGenerator.generateLicenceText(CodeGenerator.java:8907) ~[STM32CubeMX:?]
	at com.st.microxplorer.codegenerator.CodeGenerator.generateCodeFiles(CodeGenerator.java:1793) ~[STM32CubeMX:?]
	at com.st.microxplorer.codegenerator.CodeGenerator.generateDefaultConfig(CodeGenerator.java:10016) ~[STM32CubeMX:?]
	at com.st.microxplorer.codegenerator.CodeGenerator.generateCode(CodeGenerator.java:1485) ~[STM32CubeMX:?]
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.generateCode(ProjectBuilder.java:2914) ~[?:?]
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createCode(ProjectBuilder.java:2166) ~[?:?]
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:794) ~[?:?]
	at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:586) ~[?:?]
	at com.st.microxplorer.plugins.projectmanager.engine.MainProjectManager.startGenerateCode(MainProjectManager.java:1433) ~[?:?]
	at com.st.microxplorer.plugins.projectmanager.engine.MainProjectManager$3.onCommandEntered(MainProjectManager.java:274) ~[?:?]
	at com.st.components.util.CommandLineManager$3.run(CommandLineManager.java:175) ~[STM32CubeMX:?]
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308) ~[?:?]
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) ~[?:?]
	at java.awt.EventQueue$4.run(EventQueue.java:720) ~[?:?]
	at java.awt.EventQueue$4.run(EventQueue.java:714) ~[?:?]
	at java.security.AccessController.doPrivileged(AccessController.java:399) ~[?:?]
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) ~[?:?]
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:742) ~[?:?]
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) ~[?:?]
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) ~[?:?]
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) ~[?:?]
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) ~[?:?]
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) ~[?:?]
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) ~[?:?]
KO
exit
Bye bye

 

Here's the content of my script file:

 

config load <filename>.ioc
project name app
project toolchain STM32CubeIDE
project path <path>
SetCopyLibrary copy all
SetStructure Advanced
project generate
exit

 

The above error comes in the project generate step of the script. 

 

Thanks,

Sai Kiran

0 REPLIES 0