Hello!
I'm using USB driver with CDC on board with STM32F103 MCU and it works fine but when I turn on debug checks system halts on chSysLockFromISR() within usb_event() callback function at start when I call usbStart() in main. Is there something wrong?
I use ChibiOS version 182 and here is my call stack:
usb_event called not within interrupt handler Topic is solved
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: usb_event called not within interrupt handler
Hi,
Moved in "bug reports", I need to verify this.
Giovanni
Moved in "bug reports", I need to verify this.
Giovanni
Re: usb_event called not within interrupt handler
I think _usb_reset() in hal_usb.c is the place to look in. It calls _usb_isr_invoke_event_cb(usbp, USB_EVENT_RESET) which then calls usb_event().
Re: usb_event called not within interrupt handler
Giovanni wrote:Hi,
Moved in "bug reports", I need to verify this.
Giovanni
Hello Giovanni. Did you check this bug? I don't see any tickets related to it on sourceforge in section bugs.
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: usb_event called not within interrupt handler
Hi,
When a problem is reported via forum I usually create the ticket when I start working on it. Probably next weekend, immediately after the current thing (RTC driver revamp).
Giovanni
When a problem is reported via forum I usually create the ticket when I start working on it. Probably next weekend, immediately after the current thing (RTC driver revamp).
Giovanni
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: usb_event called not within interrupt handler
Hi,
I have been unable to reproduce the problem in 17.6, 18.1 and trunk, which ChibiOS version are you using?
Giovanni
I have been unable to reproduce the problem in 17.6, 18.1 and trunk, which ChibiOS version are you using?
Giovanni
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: usb_event called not within interrupt handler
Ah, it is 18.2, you specified it and I missed it...
I tested the usual USB_CDC demo and it does not trigger the problem. From usb_lld_start() there is no explicit path to usb_event(), very strange, I don't see how it can get there. The only place where _usb_reset() is called is the ISR...
What compiler are you using? if GCC, which one? using ChibiOS startups?
More questions, do you have custom interrupt handlers in your code? or a custom NVIC initialization? it looks like the USB IRQ is able to preempt within critical sections.
Giovanni
I tested the usual USB_CDC demo and it does not trigger the problem. From usb_lld_start() there is no explicit path to usb_event(), very strange, I don't see how it can get there. The only place where _usb_reset() is called is the ISR...
What compiler are you using? if GCC, which one? using ChibiOS startups?
More questions, do you have custom interrupt handlers in your code? or a custom NVIC initialization? it looks like the USB IRQ is able to preempt within critical sections.
Giovanni
Re: usb_event called not within interrupt handler
Hello Giovanni, Sorry for late response, I was busy with projects and don't have notifications enabled.
I have installed ChibiStudio preview on Windows 7 and correct me if I'm wrong, it uses GCC, OpenOCD and GDB fro debuging. there was available GCC 5.4 and 7.0, I don't remember exactly but I think I tried both compilers and also I used ChibiOS 182. I changed my computer OS and now I'm running Linux(Ubuntu) and not able to reproduce this assertion with GCC 5.4 and 7.4 using ChibiOS 182. I have ChibiStudio Installed on the computer at workspace and will try to reproduce it there in few days. I use PAL driver events and callback to capture some radio module events and wake up some some suspended threads from callback to process reception.
I have installed ChibiStudio preview on Windows 7 and correct me if I'm wrong, it uses GCC, OpenOCD and GDB fro debuging. there was available GCC 5.4 and 7.0, I don't remember exactly but I think I tried both compilers and also I used ChibiOS 182. I changed my computer OS and now I'm running Linux(Ubuntu) and not able to reproduce this assertion with GCC 5.4 and 7.4 using ChibiOS 182. I have ChibiStudio Installed on the computer at workspace and will try to reproduce it there in few days. I use PAL driver events and callback to capture some radio module events and wake up some some suspended threads from callback to process reception.
Re: usb_event called not within interrupt handler
Hello Giovanni, I tested my code on the workspace computer and wasn't able to reproduce error. I don't remember all details of my test where I have catched this error and everything seems to work fine. If I will catch this error again I will let you know with all details and conditions.
Who is online
Users browsing this forum: No registered users and 34 guests