Hi Zippy,
The assert is looking for the buffer to be a multiple of 16MiB but the ROUND_UP_UNSAFE is only doing working to a multiple of 4KiB. PAGE_SIZE_4K is hard coded in the template but the alignment has changed from 12bit to 24bit so CAmkES is aware of the large data structure.
I guess I could pad and align my data structure to a multiple of 16MiB.
Yes, you are right that CAmkES is aware of the large data structure but the generated C code is only working on a granularity of 4K pages. Hence the assertion failure occurs because the rounding causes the 'content' char array to be a multiple of 4K instead of 16MiB. So a solution would be to pad and align the data structure to be a multiple of 16MiB or you could declare the backing dataport to be a 64MiB sized buffer and then cast it to be whatever you want in the C source code. E.g. component Foo { dataport Buf(67108864) bar; }
Also, having hard coded numbers in my top level CAmkES configuration for the dataport size is a bit of a maintenance nightmare. Being able to use a #define from the code base would be ideal but this doesn't work. It does work for paddr and irq_number specifications!
You could include a C header file with a number of #defines and let the
C preprocessor process the CAmkES configuration file. To turn this
feature on, set the CMake option 'CAmkESCPP' to be 'ON' in the
component's 'CMakeList.txt' file, e.g.
set(CAmkESCPP ON CACHE BOOL "" FORCE)
and then in the CAmkES configuration file:
#include
I am porting an old application from CAmkES 2.x to CAmkES 3.7.0.
Just to let you know, we are working on a release of a newer version of CAmkES pretty soon so you may want to wait a bit. Hope this answers your questions. Sincerely, Damon