4 years, 5 months ago.

Hard Fault w/ RA8875 & GSL1680 CTP on STM32F401RE Board

I'm running this code,

Import programPUB_RA8875_Touch

A Touchscreen example program showing the RA8875 driver library. This is easily configured for either the Resistive touch panel or the Capacitive touch panel.

on a NUCLEO-64 STM32F401RE board. I've run other tests and so far it appears that the screen writing functions are working well. I was trying to get the CTP (Capacitive Touch Panel) working with the www.buydisplay.com 5" LCD (https://www.buydisplay.com/default/5-inch-tft-lcd-display-capacitive-touchscreen-ra8875-controller-800x480).

I ran the PUB_RA8875_TouchColors demo code and that does seem to work as I'm seeing RGB color codes written to the serial port when I touch a color. Each touch sends multiple responses but that's a different issue.

This tells me that my hardware connections are correct (I also ran a completely different sample code using the Arduino IDE and that worked perfectly with the same hardware connections.

The only change in the code I made was the pin definitions:

Changes to Code

//RA8875 lcd(p5, p6, p7, p12, NC, p9,p10,p13, "tft"); 
// SPI:{MOSI,MISO,SCK,/ChipSelect,/reset}, I2C:{SDA,SCL,/IRQ}, name
RA8875 lcd(PA_7,PA_6,PA_5,PB_6,PC_7, PB_9,PB_8,PB_10,PA_8, "tft"); //For Nucleo-F401RE

The hard fault I get when I run the PUB_RA8875_Touch code is this:

Serial Port Output with Hard Fault

RA8875 Touch Screen Example - Build Nov  7 2019 21:23:06

++ MbedOS Fault Handler ++

                          FaultType: HardFault

                                              Context:
                                                      R0   : 20017FCC
                                                                     R1   : 0800                                                                AFC5
    R2   : 0800AFC6
                   R3   : 0000003A
                                  R4   : 00000002
                                                 R5   : 00000003
                                                                R6   : 0FFFFFFF
                                                                               R                                                                7   : 00000032
              R8   : 0000000F
                             R9   : 20018008
                                            R10  : 00000001
                                                           R11  : 00000001
                                                                          R12  :                                                                 0000003A
         SP   : 20017FB8
                        LR   : 0800112D
                                       PC   : 0800AE56
                                                      xPSR : 01000000
                                                                     PSP  : 0000                                                                0000
    MSP  : 20017F50
                   CPUID: 410FC241
                                  HFSR : 40000000
                                                 MMFSR: 00000000
                                                                BFSR : 00000082
                                                                               U                                                                FSR : 00000000
              DFSR : 00000008
                             AFSR : 00000000
                                            BFAR : 20018008
                                                           Mode : Thread
                                                                        Priv : P                                                                rivileged
         Stack: MSP

                   -- MbedOS Fault Handler --



                                             ++ MbedOS Error Info ++
                                                                    Error Status                                                                : 0x80FF013D Code: 317 Module: 255
                                  Error Message: Fault exception
                                                                Location: 0x800B                                                                05F
   Error Value: 0x800AE56
                         For more info, visit: https://armmbed.github.io/mbedos-                                                                error/?error=0x80FF013D
                       -- MbedOS Error Info --

Any help debugging why this hard fault is happening would be greatly appreciated!

Thanks, George

1 Answer

4 years, 5 months ago.

Hi

Maybe check if you are using correct pins in

https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/TARGET_NUCLEO_F401RE/PeripheralPins.c

Jerome

I can run the PUB_RA8875_TouchColors demo and it runs fine so I would believe that to mean that my connections and definitions are correct.

posted by George Ioakimedes 14 Nov 2019