Problem with variables in memory

General discussion on mikroPascal PRO for PIC.
Author
Message
Hristo
Posts: 33
Joined: 20 Oct 2014 14:39

Re: Problem with variables in memory

#16 Post by Hristo » 25 Mar 2020 16:23

For 24 hours uninterrupted work I was unable to repeat the problem from yesterday.
Tomorrow I will continue with the additional peripherals modules that add RS485 communication to the main program.

Hristo

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: Problem with variables in memory

#17 Post by janni » 26 Mar 2020 01:51

Well, I haven't traced any sure source of S_PulsesCoin overwriting, so maybe there isn't any (wishful thinking :wink: ).

I had more detailed response ready when the forum logged me out and erased it :( (seems that mE's IT guys finally found a way to discourage the use of the forum - I'm certainly not going to log in several times a day). As I have no time to write it all again, here's only a suggestion of another safeguard - move f16_fileDesc variable in the FAT16 library file __Lib_MmcFat16_Defs.mpas to the end of RAM:

Code: Select all

var f16_fileDesc    : array [MAX_FILES] of F16_FILE;  absolute 0xC00+SizeOf(SECTOR);

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Problem with variables in memory

#18 Post by filip » 26 Mar 2020 08:14

Hi.

@janni,
I had more detailed response ready when the forum logged me out and erased it :( (seems that mE's IT guys finally found a way to discourage the use of the forum - I'm certainly not going to log in several times a day)
We apologize for the issue with the forum, please find the more detailed answer here :
viewtopic.php?f=11&t=76330

Regards,
Filip.

DarkWolf
Posts: 15
Joined: 18 Jan 2019 11:38

Re: Problem with variables in memory

#19 Post by DarkWolf » 13 May 2020 13:47

Hi,

I also had variable errors at a certain level of optimization. It worked when this variable was excluded from optimization. The volatile modifier does this.

Post Reply

Return to “mikroPascal PRO for PIC General”