0

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?)

Tomer W
  • 3,395
  • 2
  • 29
  • 44
  • What does `moduleShow()` shows after loading? You should be loading single `.o`s. I am not sure if device stream is usable in this way. You can try to create a file stream with `int fd = creat("myFile", 2)`. Then write the contents of your module by `write`. Finally load the module with `loadModule(fd, LOAD_ALL_SYMBOLS)` – Emut Jul 19 '19 at 05:36

1 Answers1

0

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.

Emut
  • 319
  • 4
  • 10
Tomer W
  • 3,395
  • 2
  • 29
  • 44