Need an example of how to programmatically use/test the vxWorks 7 vxbNorFlash driver

523 views Asked by At

I am developing a vxWorks 7.0 BSP and having trouble understanding how to use the norFlash driver provided by vxWorks 7/WindRiver.

How does one, say from usrAppInit, call the norFlash driver to read/erase/write/protect flash addresses/sectors? in sort, test the driver with my specific flash IC (AMD)?

I cannot use TFFS due to backward compatibility/legacy bootloader constraints. I have added the nor flash driver and AMD cmd set to the kernel and am able to successfully query the chip for the ID info. It is not at all clear to me how vxbNorFlash.c, vxbNorFlashLib.c and vxbNorFlashAmdCmdSetLib.c work together.

Additionally, it is not clear whether the test code should pass VIRT or PHYS addresses to the driver routines.

Does anyone have an example of how to programmatically use the vxxWorks7 NorFlash driver WITHOUT using any flash file system?

1

There are 1 answers

0
Jean-Jacques On

You might check what vxbDrvShow() and vxbDevShow() provides as output. You should use the virtual address provided to the Flash sub-system: I think this is vxbNorFlashLib.c.

If you identify which flash driver is used and registered to the sub-system you might be able to use the sub-system for developing the low level activities. Look at the attach() method for the flash driver and locate the registration call.