Tool/software: TI C/C++ Compiler
Hello,
I wonder if someone can clarify this issue for me, please.
I noticed that this is the declaration of memcpy in string.h of the compiler 20.2.2: _CODE_ACCESS void *memcpy(void * __restrict s1, const void * __restrict s2, size_t n);
For ramfuncs, I found that I cannot call it this way:
memcpy((void*)&RamfuncsRunStart, (void*)&RamfuncsLoadStart, (size_t)RamfuncsLoadSize);
but I need to call it:
memcpy((void*)&RamfuncsRunStart, (void*)&RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
Note the & before RamfuncsLoadSize.
Then I noticed in PieCtrl.c, from one of the lab exercises it has the following:
memcpy((uint16_t *)&PieVectTable+6, (uint16_t *)&PieVectTableInit+6, 448-6);
The size should be the address or a literal? I would expect that I do not need to dereference RamfuncsLoadSize and typecast it to size_t. When I step through using the debugger, the one with & is the correct one, but I am wondering about PieCtrl.c now.
Thank you.