Hot!XC8 1.44 allocates variables at same address causing endless loop

Page: < 12 Showing page 2 of 2
Author
jack@kksound
code tags!
  • Total Posts : 2116
  • Reward points : 0
  • Joined: 2014/05/14 10:03:19
  • Location: 0
  • Status: offline
Re: XC8 1.44 allocates variables at same address causing endless loop 2017/11/28 12:55:54 (permalink)
+1 (1)
1and0
PANAMATIK
I admit that the data sheet does not clearly state that the BF will be reset when SSPBUF is written, but it does.

I'm with Jack. The BF bit is cleared when SSPBUF is read, not when it's written.
 


If writting to SSPBUF ACTUALLY resets the BF flag (without a corresponding READ) then you must submit a support ticket to microchip that clearly shows this, Microchip needs to investigate. I have never seen this behavior in any other pic model.
#21
NKurzman
A Guy on the Net
  • Total Posts : 15119
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: XC8 1.44 allocates variables at same address causing endless loop 2017/11/28 14:24:36 (permalink)
+4 (4)
You can lead a horse to water...
 
 
#22
du00000001
Just Some Member
  • Total Posts : 1429
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: XC8 1.44 allocates variables at same address causing endless loop 2017/11/28 14:31:46 (permalink)
+2 (2)
@ all experts
Wouldn't be the first time I see "unexpected" behavior when leaving the trotten-out "standard procedure's" path.
Normally you wouldn't even notice such behavior.

Most times the bug is in front of the keyboard.
#23
PANAMATIK
Junior Member
  • Total Posts : 57
  • Reward points : 0
  • Joined: 2015/02/19 04:00:35
  • Location: 0
  • Status: offline
Re: XC8 1.44 allocates variables at same address causing endless loop 2017/11/28 14:40:52 (permalink)
0
I have nothing against reading SSPBUF to reset the BF bit. According to the datasheet this is the recommended way. But clearly my routine would not work if the BF bit is not reset when writing to SSPBUF. Theoretically this could change without notice in future chip versions. So it is good practice to follow only what the datasheet tells.
 
The proverb with the horse is not known here in germany. Any explanation?
 
#24
du00000001
Just Some Member
  • Total Posts : 1429
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: XC8 1.44 allocates variables at same address causing endless loop 2017/11/28 15:33:38 (permalink)
+2 (2)
The proverb IS known:
Du kannst ein Pferd zur Tränke führen - Saufen muss es alleine." 😏

Most times the bug is in front of the keyboard.
#25
DarioG
farewell.
  • Total Posts : 53177
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: porcodioland
  • Status: offline
Re: XC8 1.44 allocates variables at same address causing endless loop 2017/11/28 15:38:43 (permalink)
0
du00000001
 
Du kannst ein Pferd zur Tränke führen - Saufen muss es alleine." 😏




gross grin

forget about me, subhumans. adieu

#26
du00000001
Just Some Member
  • Total Posts : 1429
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: XC8 1.44 allocates variables at same address causing endless loop 2017/11/28 15:49:41 (permalink)
+1 (1)
Farmers' wisdom.

Most times the bug is in front of the keyboard.
#27
Gort2015
Klaatu Barada Nikto
  • Total Posts : 1549
  • Reward points : 0
  • Joined: 2015/04/30 10:49:57
  • Location: 0
  • Status: offline
Re: XC8 1.44 allocates variables at same address causing endless loop 2017/11/28 15:51:37 (permalink)
+1 (1)
"I have nothing against reading SSPBUF to reset the BF bit."
You are denying the fact that you've done it wrong or have not understood spi.
 
The data you receive in response to a command is always 1 message out of data.
Some people get lost on that because it is an exchange.
 
Look up the spi specs. and you will see MC doing the same (not differently or may change in revision)
 
 

MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
https://www.youtube.com/watch?v=Iu1qa8N2ID0
+ ST:Continues, "What Ships are Made for", Q's back.
#28
NKurzman
A Guy on the Net
  • Total Posts : 15119
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: XC8 1.44 allocates variables at same address causing endless loop 2017/11/28 16:04:11 (permalink)
+3 (3)
You can lead a horse to water, but you can't make him drink.
#29
Gort2015
Klaatu Barada Nikto
  • Total Posts : 1549
  • Reward points : 0
  • Joined: 2015/04/30 10:49:57
  • Location: 0
  • Status: offline
Re: XC8 1.44 allocates variables at same address causing endless loop 2017/11/28 16:04:38 (permalink)
+2 (2)
Is it a magic potion?
 
The C.E.O. of Dulux Paint Company has been found dead in Antarctica.
Paramedics said that he could have done with another coat.
 
 
 
 

MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
https://www.youtube.com/watch?v=Iu1qa8N2ID0
+ ST:Continues, "What Ships are Made for", Q's back.
#30
PANAMATIK
Junior Member
  • Total Posts : 57
  • Reward points : 0
  • Joined: 2015/02/19 04:00:35
  • Location: 0
  • Status: offline
Re: XC8 1.44 allocates variables at same address causing endless loop 2017/11/28 22:46:01 (permalink)
+4 (4)
Microchip support compiler analysis team has reported the issue to the compiler developers. Memory allocation for APB is not proper. The problem can occur if a function call is made by function pointer and directly from another location. Workaround: either calling the same function only directly or only via function pointer.
#31
mbrowning
Just a Member
  • Total Posts : 611
  • Reward points : 0
  • Joined: 2005/03/16 14:32:56
  • Location: Melbourne, FL
  • Status: offline
Re: XC8 1.44 allocates variables at same address causing endless loop 2017/11/29 04:56:14 (permalink)
0
Thanks for reporting. A buggy compiled stack is worrisome.

Can't remember. I've slept since then - Mark
#32
Gort2015
Klaatu Barada Nikto
  • Total Posts : 1549
  • Reward points : 0
  • Joined: 2015/04/30 10:49:57
  • Location: 0
  • Status: offline
Re: XC8 1.44 allocates variables at same address causing endless loop 2017/12/05 15:26:14 (permalink)
0
"directly from another location."
I think you mean by indirect addressing.

MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
https://www.youtube.com/watch?v=Iu1qa8N2ID0
+ ST:Continues, "What Ships are Made for", Q's back.
#33
Page: < 12 Showing page 2 of 2
Jump to:
© 2017 APG vNext Commercial Version 4.5