?
Result cosmic Report"Segment. ubsct Overflow"The root cause of the error isMemory Overflow, The Cause analysis is as follows:
?
1. Variable storage space structure
?
The RAM address range of the 8s105 series CPU is 0 ~ 2 K space of 0x7ff, in which 512 bytes are allocated to the stack by default, leaving 0 ~ 0x5ff is the variable storage space. From 0 ~ Within the spatial range of 0x5ff, 256 bytes are defined as zero page, including. BSCT,. ubsct,. Bit,. Share
?
It can be seen that when the segment. ubsct overflow error occurs, it should be 0 ~ FF segment space Overflow
?
By default, cosmic stores all variables in the zero page segment. If you want to place the variables in the 0x100 ~ In the space 0x5ff, you need to add @ near declaration before the variable, just like the idata function.
?
Add @ near Declaration to all global variables to store buckets outside zero page.
?
However, it is not too difficult to compile variables. After carefully reading the materials, we found that ccompiler can be found in the project settings to change memort models to long stack.
?
The last method fails on ipv8s903k3. You can use the @ near method to select some variables with low usage frequency and add @ near before it.
?