Skip to main content
Tushar Jambhekar
Associate
March 24, 2017
Question

Hard fault while calling function (EP1_IN_Callback) by pointer

  • March 24, 2017
  • 2 replies
  • 670 views
Posted on March 24, 2017 at 17:46

I am developing program for usb communication and i am using 'STM32_USB-FS-Device_Driver' library in atollic true studio.

in USB communication when EP2_OUT_Callback is working properly. but during interrupt for EP1_IN_Callback hard fault occurs.

on further investigation i found that EP1_IN_Callback pointer address is '134217776' (i.e. even address and hence causing hard fault)

i tried using _packed keyword but compiler ignores it. 

how can i solve the issue?

    This topic has been closed for replies.

    2 replies

    Tushar Jambhekar
    Associate
    March 25, 2017
    Posted on March 25, 2017 at 04:33

    I further investigated the issue and here are my observations

    in map file address of EP1_IN_Callback is 0x0800231c.

    whereas while calling the function by pointer; pointer points to 0x08000030

    Things are working fine for EP2_OUT_Callback

    Tushar Jambhekar
    Associate
    March 25, 2017
    Posted on March 25, 2017 at 05:49

    I have resolved the issue. the pointer value was getting overwritten due to array overrun