stm8S003 constants at a fixed memory address
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-07-27 5:00 AM
Posted on July 27, 2012 at 14:00
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?
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-07-27 6:45 AM
Posted on July 27, 2012 at 15:45
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 -kOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-08-01 7:54 AM
Posted on August 01, 2012 at 16:54
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
charlesOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-08-01 7:58 AM
Posted on August 01, 2012 at 16:58
sorry it is stm8s_config.h
charlesOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2012-08-01 8:06 AM
Posted on August 01, 2012 at 17:06
again my ingers got ahead of my head stm8s.flash is really stm8s_flash.c
charles