Search code examples
moduleembeddedvxworksloadmodule

debugging vxworks loadModule failure


I have a VxWorks Image Project project without a File-System on MPC5200B, using DIAB tool-chain.
I need to dynamically load a module from flash.

I allocated memory on my stack char myTemporaryModuleData[MAX_MODULE_SIZE]
and filled it with the module data from Flash.
(checked that the binary data is intact)

then i create a memDevice('/mem/mem01', myTemporaryModuleData, moduleReadLength)
open the psuedo-stream int fdModuleData = open("/mem/mem01", O_RDONLY, 777);

when i run int mId = loadModule(fdModuleData, LOAD_ALL_SYMBOLS);
did not see anything in the console after running loadModule();
but mId = 0 which indicates failure :(.
getErrno() returned 0x3D0004 (S_objLib_OBJ_TIMEOUT)

NOTE: it didn't take long at all to fail => timeout?

  1. i tried replacing the module with a simple void foo() { printf(...); } module but still failes with same issue.

  2. tried loading an .out instead of .o

unfortunately, nothing got me nowhere,
How can i know what caused it to fail? (log, last_error, anything i should check?)


Solution

  • FOUND IT. Apparently, it was a mistake in the data read from the flash.

    What I can contribute is that 'loadModule()' from memDrv device is possible and working.