2013-05-14 05:04 AM
Dear collegues,
I experience a trouble with writing code for STM32L152VBT. Let me explain sequentially. I had my PCB with chip STM32L152VBT. I took the example project from STM32_USB-FS-Device_Lib_V4.0.0 and adopt to my chip. Run the project. Everything work perfectly. OK. Because I planned to use USB loader, I corrected memory boundaries with agreement UM0424 (USB-FS-Device development kit): ROM start from 0x08003000 and add line in my code: NVIC_SetVectorTable(NVIC_VectTab_FLASH,0x3000); Compile the project. It seems everything OK. As soon I had added my code, the program crashed. Sometimes it stopped at adress below 0x08003000. Sometimes chip couldn't be stopped at all! I have no idea what to do. What is the trouble? In which direction should I dig? Help! Best regards, Ivan Z. #usb #virtualcomport2013-05-14 06:47 AM
Around here we break out the debugger and go fishing.
If it break because you change the vector table address, then perhaps you should assume you still have a couple of interrupts enabled for which your new table does not have service routines for? Getting hard faults, use a proper handle to decompose the failure state.2013-05-15 12:28 AM
Clive,
Thank for fast responce! I checked it the first of all. I don't get ''Hardware fault interrupt''. I am about to rewrite program. It is very similar to troubles with a vector table. But I can't catch error. =( And I don't know why the MassStorageDevice worked perfectly in the same case. :(( Others ideas, methods, hypothesises?2013-05-15 01:30 AM
I FOUND
The function Leave_LowPowerMode(void) in hw_config.c called SystemInit() (what for?), where vector table was reset back to default state. (VECT_TAB_OFFSET was 0). I corrected line#define VECT_TAB_OFFSET 0x3000
And everything run!
Thank you very much! ;)