ARMstamp 11U37 hard fault

Questions about the BASICtools and MakeItC
Post Reply
olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

ARMstamp 11U37 hard fault

Post by olzeke51 »

Hello Basicchip,
I am getting a 'hard fault at 47b6, fairly constantly.
after I enter a keyboard character !!
*
edit: changed the pointer to the correct value and it has not failed yet tho I did keep the 2nd MyByte2
*
*

Code: Select all

'  **DO 
    MyByte = RXD(0)		
		
UNTIL MyByte >= 0
MyByte2 = RXD(0)
IF time_idx > 511 then goto Oops
print "you entered >> ";MyByte
'wait(1000)
'stop
Task_r()
a)the WAIT seemed to eliminate the hard fault ; else it showed up in Task_r() sometimes
b) stop was for locating hard fault -- at times it would fault BEFORE my stop !!
c)I added the MyByte2 incase the keyboard <enter> key was an extra character
. to try and troubleshoot the Break caret showing up on the next line
. ran blinky with a stop at the end to verify it is in the 'usually here' position
.???
???? any comments about the function that is causing the 'hard fault @ 47b6"??????
1st  run
1st run
hardfault01.gif (7.14 KiB) Viewed 6683 times
added mybyte2
added mybyte2
hardfault02.gif (10.31 KiB) Viewed 6683 times
'
'
edit:: I am using Timer2 for a 50ms timing loop for my software RTC
adding a second "MyByte2 = RXD(0)" seems to have cleared the caret back to its "usually here" position
Last edited by olzeke51 on Mon Apr 13, 2020 12:43 am, edited 1 time in total.



olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: ARMstamp 11U37 hard fault

Post by olzeke51 »

AND here is my Task_r() run as a main:

Code: Select all

#include "LPC11u3x.bas"
Main:
DIM T_day, T_hour, T_min, T_ON, T_start, T_data, T_addr,tempture, idx
DIM Sector1(511)
dim BIG$(35)

for idx = 0 to 511
T_data = Sector1(idx)
T_addr = ADDRESSOF(T_data)
	T_day =  RD_BYTE(T_addr +3)
	T_hour = RD_BYTE(T_addr +2)   
	T_min =  RD_BYTE(T_addr +1)   
	tempture =  RD_BYTE(T_addr +0)
	'
	idx +=1	
	T_data = Sector1(idx)
	T_ON = RD_HALF(T_data)    <<<<<<<<
	T_start = RD_HALF(T_data) <<<<<<<< should be (T_addr,  and T_addr + 2)

	BIG$=SPRINTF("%2d,%2d,%2d,%2d,%5d,%3d%c",T_day,T_hour,T_min,tempture,T_start,T_ON,13)
	print BIG$	
next	'should advance idx
END

and it prints with no issues -- !!not sure where the 8160 comes from!!<<<<< bad pointer

olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: ARMstamp 11U37 hard fault - WORKING NOW

Post by olzeke51 »

A new day, more brain power....
well, actually had a slow time getting to sleep....
it dawned on me that &H47b6 was most likely in my program area!
'
sure enough, here is the Tools/Debug/Code data::
hardfault03.gif
hardfault03.gif (6.8 KiB) Viewed 6672 times
'
and you can see that Task_r is in that area!!
BUT - it doesn't explain the hardfault occuring BEFORE I call the Task_r!!!
'
I did find a possible cause - in that I was formatting SPRINTF wrong for the values I fed it ??
The bad pointer( as I previously mentioned) would just give me erroneous data

Post Reply