stm32 usb usb_init HardFault -
i'm trying run virtual_com_port stm32_usb-fs-device_lib_v4.0.0. i'm using iar 7.3. buld ok, not run usb. started use debugger. in function
void usb_init(void) { pinformation = &device_info; pinformation->controlstate = 2; pproperty = &device_property; puser_standard_requests = &user_standard_requests; /* initialize devices 1 one */ pproperty->init(); }
on line pproperty = &device_property; debugger jumps exception handler hardfault_handler. problem? problem whith iar or settings?
you accesing memmory shouldn't. hardfault_handler default catches exceptions, configurable fault exceptions disabled. try turning on memmanage_fault:
scb->chcsr |= scb_shcsr_memfaultena_msk; //set priority of memmanage fault (using cmsis): nvic_setpriority(memorymanagement_irqn, *priority*); //default name memmanage fault function is: void memmanage_handler(void);
after hardfault turn memmanage_fault. not much, gives better idea of dealing with.
also see link debugging hardfaults on iar.
i can't sure without seeing set device_property variable double check ok give it's memory address else.
Comments
Post a Comment