2003-04-09 01:13 AM
STPC/Atlas - Vxworks - Video Driver
2003-03-31 01:56 AM
Hi
I'm currently developping a man machine interface for an embedded system which runs under vxworks 5.4.2 The processor of the board is an ST-Microelectronics STPC Atlas, which manages video, keyboard, and more. My question is about the video part. The Graphical Developpment Kit given by ST offers lots of useful libraries, including 2D acceleration routines, etc, so we want to use these. The graphical engine allocates 16MB, the system is equipped with 32MB of RAM so this should be OK. This GDK specify severals layers, from the hard to the soft : -Hardware layer (stpc atlas) -OS Layer (vxworks) -OS Application Layer (OSAL) -Drivers -Applications In order to use theses libraries the only thing i have to do is to modify the OSAL so that libraries will run under vxworks, and then i'll be able to write the driver. The problem is there : in the OSAL library, the init part requires the mmap function in order to map the memory of the graphical unit. This is required when the OS has an MMU, and vxworks is configured with an 1:1 mmu type (mmu is transparent , virtual address=real address) So i would like to know how can i replace the mmap function. I tried many things, like malloc but nothing works. Could somebody help me ? Tresh2003-03-31 09:26 PM
Tresh,
The OSAL_MemoryMap function is not a function to allocate or reserved memory but just to return a pointer on a physical address. As you explain yourself, VxWorks doesn't use the MMU and you can return directly the requested address as 'handle' to be used by OSAL_MemoryRead and OSAL_MemoryWrite functions. #define OSAL_MemoryMap(base, size ) ( (unsigned long) base ) Then to access memory: #define OSAL_MemoryWrite8(virtual, offset, data) { *((unsigned char *)(virtual + offset)) = data; } #define OSAL_MemoryRead8(virtual, offset) ( *((unsigned char *)(virtual + offset)) ) etc... We have already developped a VxWorks OSAL layer for old version of the kit (GDK1.4). It should also work with lastest versions of STPC-DK. You will find in the attached src.zip our osal.c and osal.h as well as the porting of the assembly language files (ge.s, cursor.s and afe.s) which are very similar to linux versions. Farfalla ________________ Attachments : SRC.ZIP : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzMc&d=%2Fa%2F0X0000000bKY%2Fn7CKTIteasPU6uQIlvQNX_T3O8s.D_RP8AWPbmWc5g4&asPdf=false2003-04-01 04:20 AM
Thanks a lot for your precious help and your source code.
Unfortunately, it seems that the test crashes during initialization (page fault). (i compiled and run samples/basic/fill.c) What would be the next thing to check ? is there any special memory configuration to add when creating the vxworks kernel ? For example, when i try to access the graphic engine registers (0x8400000) from the shell, i also get a page fault -> this address is not reachable ?!? Again, thank you for your support Tresh.2003-04-03 09:04 PM
Hello Tresh,
you are right, the memory mapped registers and the frame buffer space at 128MB must be declared in a descriptor table located in the file in syslib.c. I attached a detailed documentation that can help you further running vxWorks with the GDK. Fab ________________ Attachments : vxworks.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtuL&d=%2Fa%2F0X0000000aYd%2FkOkYRQ7KoSbnqL28srzqJksI0RlNpZ6iRQpuHu2sKWg&asPdf=false2003-04-09 01:13 AM
Hello Fab
the video works fine now except for some demos that crash after several executions, but now the main thing is that i can develop the interface thanx again for all your help Tresh