Uploading static vector through linker script #1076
Replies: 1 comment 5 replies
-
This is a very hard question as this highly depends on your actual use case...
Hmm, good question... Declare your data vector (could also be an array) as a global constant somewhere in your C sources: const uint32_t your_vector = 0x12345678; Then you could define a constructor (getting executed before void __attribute__((destructor)) copy_your_vector(void) {
uint32_t* dst = 0xABCD0000; // this is the destination address of your vector in DDR
uint32_t* src = (uint32_t*)(&your_vector[0]);
for (i=0; i<(sizeof()/4); i++) {
*dst++ = *src++;
}
} This is not perfect, but it should do the job I think. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I have a question regarding the linker script. I have a series of bytes that have to be stored starting from a fixed memory address in the ddr of the device that I am using. However, for now i have no way of initializing it during boot phase (i am currently working to find a solution to this) so i was wondering if i could upload this data through the AXI interface of the neorv. However, receiving this data from uart and forwarding it toward the AXI interface requires to much time, and it is to big to be stored in the BRAMS of the device (i don't have enough).
I was just wondering, what happens if i modify the linker script by adding the vector at a fixed position in memory (a void one, such as 0xF0000000)? Will it be forwarded towards the AXI interface since it points to a void memory location and thus propagate towards the external resource to which the risc is connected? Is this a thing or I have to find another way?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions