2012-07-27 05:00 AM
Hello
I'm trying place constants at fixed memory address according to this link My code is:#pragma section const {sver}const uint8_t SV_HIGH=1; const uint8_t SV_MID=2; const uint8_t SV_LOW=3; #pragma section const{}I added new segment into linker file:+seg .sver -b 0x9f10And linker returns:#error clnk oprawa_v1.lkf:1 bad address (0x9f11) for zero page symbol _SV_MID#error clnk oprawa_v1.lkf:1 bad address (0x9f12) for zero page symbol _SV_LOW#error clnk oprawa_v1.lkf:1 bad address (0x9f10) for zero page symbol _SV_HIGHCan Any One help?2012-07-27 06:45 AM
problem was in other file
I by mistake badly externed const variablewas:extern uint8_t SV_HIGH; should be:extern const uint8_t SV_HIGH; but whilst declaring segment you should use -k option becouse compiler optimizes your variable. for example:+seg .sver -b 0x9f10 -k2012-08-01 07:54 AM
You havew to go into stm8s.config and uncomment out define flash 1 and then use the routines in stm8s.flash I think that is the esame in cosmic as in raisonance
charles2012-08-01 07:58 AM
sorry it is stm8s_config.h
charles2012-08-01 08:06 AM
again my ingers got ahead of my head stm8s.flash is really stm8s_flash.c
charles