Hey everybody,
I'm currently in the process of porting uPy to the Tiva Launch Pad.
I'm having problems calling
>>> p = Pin('PF2', Pin.OUT)
because the controller goes into the FaultISR(). (Handler for hard faults)
I suspect a nullpointer dereference, but not in my own code, so I have no idea why.
'PF2' is a valid pin name.
The callstack looks like this:
And in this line the fault happens:
I cannot step into it.
Here are the values of the local variables right before the call:
Does anybody know why this is happening?
I'm grateful for any ideas!
-ExXec
-------------------------------------------------------------------------
My fork: https://github.com/ExXeptional/micropyt ... ts/tm4c123
[Tiva TM4C123] [solved] I'm getting a hard fault when initializing a Pin
[Tiva TM4C123] [solved] I'm getting a hard fault when initializing a Pin
Last edited by ExXec on Sun Dec 16, 2018 10:02 pm, edited 1 time in total.
My fork/port: https://github.com/rk-exxec/micropython ... ts/tm4c123
Re: [Tiva TM4C123] I'm getting a hard fault when initializing a Pin
You show that fun_in is 0x00000000 so the address of the routine you're trying to call is the null pointer, which is what's causing the exception and why you can't step into it.
So you need to work backwards and figure out why fun_in is null.
So you need to work backwards and figure out why fun_in is null.
Re: [Tiva TM4C123] I'm getting a hard fault when initializing a Pin
Ok, I tracked it down to this expression:
this returns 0x00000000
I copied that part from the stm32 port, so I don't know what this does
Code: Select all
MP_STATE_PORT(pin_class_mapper)
I copied that part from the stm32 port, so I don't know what this does
My fork/port: https://github.com/rk-exxec/micropython ... ts/tm4c123
Re: [Tiva TM4C123] I'm getting a hard fault when initializing a Pin
The code only calls that function if pin_class_mapper is not equal to mp_const_none. mp_const_none isn't the value 0x00000000
pin_class_mapper is initialized to mp_const_none in the function pin_init0 which should be called from your main.c as it is here:
https://github.com/micropython/micropyt ... ain.c#L587
pin_class_mapper is initialized to mp_const_none in the function pin_init0 which should be called from your main.c as it is here:
https://github.com/micropython/micropyt ... ain.c#L587
Re: [Tiva TM4C123] I'm getting a hard fault when initializing a Pin
yeah that was the problem, thanks
My fork/port: https://github.com/rk-exxec/micropython ... ts/tm4c123