summaryrefslogtreecommitdiffstatshomepage
path: root/stmhal/stm32_it.c
Commit message (Collapse)AuthorAge
* all: Use the name MicroPython consistently in commentsAlexander Steffen2017-07-31
| | | | | There were several different spellings of MicroPython present in comments, when there should be only one.
* stmhal: Clean up some header includes.Damien George2017-07-03
|
* stmhal: Rename sys_tick ticks/delay functions to corresp. mp_hal ones.Damien George2017-03-02
| | | | | | | | | | | | The renames are: HAL_Delay -> mp_hal_delay_ms sys_tick_udelay -> mp_hal_delay_us sys_tick_get_microseconds -> mp_hal_ticks_us And mp_hal_ticks_ms is added to provide the full set of timing functions. Also, a separate HAL_Delay function is added which differs slightly from mp_hal_delay_ms and is intended for use only by the ST HAL functions.
* stmhal: Implement a proper thread scheduler.Damien George2017-02-15
| | | | | | This patch changes the threading implementation from simple round-robin with busy waits on mutexs, to proper scheduling whereby threads that are waiting on a mutex are only scheduled when the mutex becomes available.
* stmhal: Add pyb.fault_debug() function, to control hard-fault behaviour.Damien George2017-02-06
| | | | | | | | | This new function controls what happens on a hard-fault: - debugging disabled: board will do a reset - debugging enabled: board will print registers and stack and flash LEDs The default is disabled, ie to do a reset. This is different to previous behaviour which flashed the LEDs and waited indefinitely.
* stmhal: On HardFault, print stack pointer and do a stack dump.Damien George2017-02-06
|
* stmhal: Fix build issue when MICROPY_PY_THREAD is disabled.Damien George2017-01-31
|
* stmhal: Initial implementation of multithreading, currently disabled.Damien George2017-01-31
| | | | | | | | | | | | | | | This patch brings the _thread module to stmhal/pyboard. There is a very simple round-robin thread scheduler, which is disabled if there is only one thread (for efficiency when threading is not used). The scheduler currently switches threads at a rate of 250Hz using the systick timer and the pend-SV interrupt. The GIL is disabled so one must be careful to use lock objects to prevent concurrent access of objects. The threading is disabled by default, one can enabled it with the config option MICROPY_PY_THREAD to test it out.
* stmhal/uart: Add support for UART7 and UART8 on F7 MCUs.Damien George2016-12-05
|
* stmhal/i2c: provide custom IRQ handlersKrzysztof Blazewicz2016-11-16
| | | | | Use custom handlers providing minimal required functionality because those provided by ST increase code size by almost 2 KiB.
* stmhal/i2c: handle I2C IRQsKrzysztof Blazewicz2016-11-16
| | | | This is required by HAL Driver for error handling since v1.5.0
* stmhal: Fix timer capture/compare interrupt handling for TIM1 and TIM8.Dave Hylands2016-08-22
| | | | | | | | | | | | | | | | | | It turns out that TIM1 and TIM8 have their own Capture/Compare interrupt vector. For all of the other timers, the capture/compare interrupt vector is the same as the update vector. So we need to add handlers for these vectors and enable them when using capture/compare callbacks. During testing of this, I also found that passing a channel callback into the channel constructor would not enable interrupts properly. I tested using: ``` >>> pyb.Timer(1, freq=4).channel(1, pyb.Timer.OC_TOGGLE, callback=lambda t: print('.', end='')) ``` I tested the above with channels 1, 4, and 8
* stmhal: L4: Adapt startup code, clock configuration and interrupts.Tobias Badertscher2016-05-05
|
* stmhal: Make TIM3 available for use by the user.Damien George2016-01-29
| | | | | | | TIM3 is no longer used by USB CDC for triggering outgoing data, so we can now make it available to the user. PWM fading on LED(4) is now gone, but will be reinstated in a new way.
* stmhal: Make USB CDC driver use SOF instead of TIM3 for outgoing data.Damien George2016-01-29
| | | | | | | | | | | | Previous to this patch the USB CDC driver used TIM3 to trigger the sending of outgoing data over USB serial. This patch changes the behaviour so that the USB SOF interrupt is used to trigger the processing of the sending. This reduces latency and increases bandwidth of outgoing data. Thanks to Martin Fischer, aka @hoihu, for the idea and initial prototype. See PR #1713.
* stmhal: Add pyb.irq_stats() to get statistics about IRQ calls.Damien George2015-12-22
| | | | | | | | | | | | | Adds a lot of code, makes IRQs a bit less efficient, but is very useful for debugging. Usage: pyb.irq_stats() returns a memory view that can be read and written, eg: list(pyb.irq_stats()) pyb.irq_stats()[0] pyb.irq_stats()[0] = 0 The patch provides general IRQ_ENTER() and IRQ_EXIT() macros that can be modified to provide further IRQ statistics if desired.
* stmhal: Enable two USB phys to be supported together.neilh102015-12-09
| | | | | | | | | | | | | This is refactoring to enable support for the two USB PHYs available on some STM32F4 processors to be used at the same time. The F405/7 & F429 have two USB PHYs, others such as the F411 only have one PHY. This has been tested separately on a pyb10 (USB_FS PHY) and F429DISC (USB_HS PHY) to be able to invoke a REPL/USB. I have modified a PYBV10 to support two PHYs. The long term objective is to support a 2nd USB PHY to be brought up as a USB HOST, and possibly a single USB PHY to be OTG.
* stmhal: Add option to free up TIM3 from USB VCP polling.Damien George2015-12-04
| | | | | | | | This is a hack to free up TIM3 so that it can be used by the user. Instead we use the PVD irq to call the USB VCP polling function, and trigger it from SysTick (so SysTick itself does not do any processing). The feature is enabled for pyboard lite only, since it lacks timers.
* stmahl: Fix usbd_conf.c for devices which don't have USB_HS at all.Dave Hylands2015-11-26
| | | | | | | | The STMCube examples define both USE_USB_HS and USE_USB_HS_IN_FS when they use the HS in FS mode. The STM32F401 doesn't have a USB_HS at all, so the USB_OTG_HS instance doesn't even exist.
* stmhal: Add support for the STM32F429I-DISCO kit by STMicro.Tobias Badertscher2015-11-25
|
* stmhal: In SysTick IRQ handler, make uwTick variable non-volatile.Damien George2015-11-24
| | | | | | uwTick can only change in the SysTick IRQ so this IRQ function does not need to take special care with this variable. It's important to make this IRQ function as efficient as possible.
* stmhal: Move flash storage idle tick handler from TIM3 to SysTick.Damien George2015-11-24
| | | | | | | | Using SysTick to do the counting and dispatch of the flash storage idle handler is more efficient than requiring a dedicated hardware timer. No new counter is needed, just the existing uwTick variable. The processing is not actually done in the SysTick IRQ, it is deferred to the flash IRQ (which runs at lower priority).
* stmhal: On SysTick IRQ, only process one DMA channel at a time.Damien George2015-11-24
| | | | | | This can be generalised if/when more processing is needed by SysTick. Thanks to @chuckbook for the idea.
* stmhal: Turn off DMA clocks when idle for 100 msecDave Hylands2015-11-24
| | | | | | | | | | Turning on each DMA block increases the current consumption by about 8 mA. This code adds an idle timer for each DMA block and turns off the clocks when no streams are in use for 128 msec. Having a small timeout allows for improved performance when back-to-back transfers are being performed. The 128 msec is basically a guess.
* stmhal: Print more information at HardFault time.Dave Hylands2015-11-07
|
* all: Add py/mphal.h and use it in all ports.Damien George2015-10-31
| | | | | | py/mphal.h contains declarations for generic mp_hal_XXX functions, such as stdio and delay/ticks, which ports should provide definitions for. A port will also provide mphalport.h with further HAL declarations.
* stmhal: Add debug capability to print out info about a hard fault.Damien George2015-08-03
| | | | | | Capability is #if'd off by default. Thanks to Dave Hylands for the patch.
* stmhal: Renamed startup/system/_it.[ch] file to generic names.Dave Hylands2015-07-30