Hello all,
I started using SDCC compiler for last few months. I am finding following problem whenever I do some manipulation with big arrays or structures. Could someone provide me info why I get these type of error message. I get these errors though declare all my varibales in XDATA.
?ASlink-Error-Could not get 4 consecutive bytes in internal RAM for area DSEG.
?ASlink-Error-Could not get 4 consecutive bytes in internal RAM for area OSEG.
?ASlink-Error-Could not get 8 consecutive bytes in internal RAM for area OSEG.
?ASlink-Error-Could not get 4 consecutive bytes in internal RAM for area OSEG.
If someone had this problem and solved please provide me details. Thank you in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This means you ran out of data memory. And it probably is because the code needs many temporaries that get stored in DSEG or OSEG. It can help to change to --stack-auto as the stack can use idata too, but beware of stack overflow.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I still go with --stack-small model. I changed many of custom library functions developed by me to have as less local variables & function parameters. I got rid of this error for the moment and I consume DATA size 113 Bytes (+143 Bytes Stack). I feel this problem comes excess use of functions such as sprintf and other string manipulation function as well.
I don't want to risk with idata. If you know some other optimisation method to reduce data memory, please let me know. Thanks in advance !!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can manually place larger (global/static) variables (esp. arrays & structs) in __idata/__pdata/__xdata.
__idata is cheapest in code and performance, but costs stack space and is limited.
__pdata is a bit larger but less efficient.
__xdata is the largest but least efficient.
Last edit: Maarten Brock 2013-06-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello all,
I started using SDCC compiler for last few months. I am finding following problem whenever I do some manipulation with big arrays or structures. Could someone provide me info why I get these type of error message. I get these errors though declare all my varibales in XDATA.
?ASlink-Error-Could not get 4 consecutive bytes in internal RAM for area DSEG.
?ASlink-Error-Could not get 4 consecutive bytes in internal RAM for area OSEG.
?ASlink-Error-Could not get 8 consecutive bytes in internal RAM for area OSEG.
?ASlink-Error-Could not get 4 consecutive bytes in internal RAM for area OSEG.
If someone had this problem and solved please provide me details. Thank you in advance.
This means you ran out of data memory. And it probably is because the code needs many temporaries that get stored in DSEG or OSEG. It can help to change to --stack-auto as the stack can use idata too, but beware of stack overflow.
Thank you Maarten !!!
I still go with --stack-small model. I changed many of custom library functions developed by me to have as less local variables & function parameters. I got rid of this error for the moment and I consume DATA size 113 Bytes (+143 Bytes Stack). I feel this problem comes excess use of functions such as sprintf and other string manipulation function as well.
I don't want to risk with idata. If you know some other optimisation method to reduce data memory, please let me know. Thanks in advance !!!
You can manually place larger (global/static) variables (esp. arrays & structs) in __idata/__pdata/__xdata.
__idata is cheapest in code and performance, but costs stack space and is limited.
__pdata is a bit larger but less efficient.
__xdata is the largest but least efficient.
Last edit: Maarten Brock 2013-06-06