I am trying to use the grlib provided with the AM335x Starterware. The first call I make is to GrOffScreen1BPPInit , which is in offscr1bpp.c. In that function, the instruction
*(unsigned short *)(pucImage + 1) = lWidth;
causes an un-aligned access, hence the trap. pucImage is a passed parameter defined as:
unsigned char g_pucBuffer[2][GrOffScreen1BPPSize(DOC_WIDTH, DOC_HEIGHT)];
where the GrOffScreen1BPPSize macro is defined in grlib.h as:
#define GrOffScreen1BPPSize(lWidth, lHeight) \
(5 + (((lWidth + 7) / 8) * lHeight))
So it appears that the buffer is intentionally defined with a 5 byte header, then unaligned accesses used to populate it.
Is this a known bug in grlib?
Gerry Belanger