Changing pulpissimo memory layout
#1
Hello everyone,

I would like to ask you how to change memory layout of pulpissimo

My problem is that I need to use code that uses big vectors. Then, when  I run the program in the virtual platform I got:

3699418377: 147973: [/sys/board/chip/soc/fc/warning                   ] Invalid access (offset: 0x1bfffcd8, size: 0x4, is_write: 1)

Which is a problem of stack overflow. I could move big vectors to other memory sections but this implies to modify the code, which i shouldn't. Also, sometimes I got problems with the code size. So in general I would like to know how to modify the memory to be able to execute the code without modifications.

The problem can be reproduced with the following code:

Code:
#include <stdio.h>
void writefnctext();
void printVector(char *vector1, unsigned int len);
void fillVector(char *vector1, unsigned int len);
int main()
{
    char vector1[4096]; // Does not work, gets an invalid access.
    printf("Hello !\n");
    fillVector(vector1, 4096);
    printVector(vector1, 4096);
    writefnctext();
    return 0;
}
void writefnctext(){
    printf("Function has been called successfully");

}
void fillVector(char *vector1, unsigned int len){
    for (unsigned int i=0;i<len; i++ ){
        vector1[i]=i;
    }
}
void printVector(char *vector1, unsigned int len){
    for (unsigned int i=0;i<len; i++ ){
        printf("%d ", (int) vector1[i]);
    }
    printf("\n");
}



Thanks in advance!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)