Commit Graph

13287 Commits

Author SHA1 Message Date
David Sidrane
36da2b91c5 Kinetis:USB-FS driver
Removed the notion of attached. The khci_usbattach is call early in
   the init either in board_initalize or in board_app_initalize. In
   either case it is always done prior to the the class register.
   Therefore the khci_usbattach call only set a flag, and that
   flag is only tested in the class register. The class register will
   enable the soft connect pull up.
2017-06-06 14:39:00 -10:00
David Sidrane
cb62675b5e Kinetis:sim ensure isolation of clock dividers for 0 value case
This fixes a bug were a SoC does not have a clockdivN register
   and passes a 0 for the init value. This prevents overflow of
   the 0 decremented to -1 (0xffffffff) spilling over to other
   clockdivN feilds.
2017-06-06 14:38:59 -10:00
David Sidrane
60c552ae0f Kinetis:usbdev clean up ensuring proper use of HW.
Remove magic numbers from code, documented the use of
  undocumented bits.

  Remove comments and code that were not appropriate for this
  hardware.

  Removed ifdef that's that were always compiled and removed code
  blocks that were never compiled.

  Ensure proper access order to hardware.
  Per the reference manual: disable endpoints prior to configuring buffer
  descriptor, then enable endpoints
  Reorganize interrupt processing order to offload data after processing
  errors.

  Reorganize initialization so that there is a clear initialization phase,
  reset phase for both the hardware and software structures.

  By breaking the initialization into smaller pieces, the reset interrupt
  only resets the resources within the controller that should be reset.

  Rework suspend and resume logic so they perform properly

  Made attach and detach functions optional. As they do not make sense for
  a bus powered device.

  Ensured the calls to up_usbinitalize up_usbuninitalize do not violate the
  USB spec.
2017-06-06 14:38:59 -10:00
David Sidrane
c1a3208f83 Kinetis:Disable MPU when not in protected mode.
The hardware reset state of the the MPU precludes any bus
   masters other then DMA access to memory. Unfortunately
   USB and SDHC have there own DMA and will not have access to
   memory in the default reset state.

   This change disabled the MPU if present on system startup.
2017-06-06 14:38:58 -10:00
Gregory Nutt
4d46979a6f Tiva SSI: Resolves issue 52 'Copy-Paste error in tiva_ssibus_initialize()' submitted by Aleksandr Kazantsev. 2017-06-01 06:38:47 -06:00
Juha Niskanen
ad6515563b STM32L4 RTC: store RTC MAGIC to backup reg, not to address zero 2017-06-01 06:15:28 -06:00
Jussi Kivilinna
369b72f65a stm32f7: Add SPI DMA support 2017-05-31 09:13:20 -06:00
Juha Niskanen
14c233a2f5 STM32L4: gpio: put back EXTI line source selection 2017-05-31 06:34:14 -06:00
David Sidrane
a077d0285b Kinetis:Added ADC channel macro 2017-05-25 16:52:08 -10:00
David Sidrane
b407020968 Kinetis:Fixed typo in kinetis_adc.h 2017-05-25 16:51:25 -10:00
David Sidrane
488f42588b Kinetis:Removed base address from kinetis_adc.h 2017-05-25 16:50:42 -10:00
Juha Niskanen
0c9abbfe67 STM32L4: Add IWDG peripheral. This is the same as for STM32 except that prescale and reload can be
changed after watchdog has been started, as this seems to work on L4.
2017-05-23 07:02:36 -06:00
Gregory Nutt
32eb5ca99a Missed one change in the previous commit. 2017-05-21 15:02:00 -06:00
Gregory Nutt
7ffbb704d6 This is based on a patch by Taras Drozdovsky. Basically, the delay that was added during the integration of the CDC/ACM host driver was interfering with streaming audio. That delay was put there to prevent build endpoints from hogging the system bandwidth. So what do we do? Do we hog the bandwidth or do we insert arbitrarity delays. I think both ideas such. 2017-05-21 14:28:29 -06:00
Taras Drozdovsky
4ab2a3661e STM32F4: add cs43l22 audio driver and i2s driver 2017-05-21 14:14:09 -06:00
Juha Niskanen
819a6e049e stm32_i2c: make private symbols static 2017-05-19 07:16:01 -06:00
Gregory Nutt
989195cec8 STM32 Ethernet: Last patch breaks every board that does not use the KSZ80801 PHY. 2017-05-17 15:36:57 -06:00
Gregory Nutt
aac3a3df8e STM32 Ethernet: Should not stm32_phyintenable() return a failure if it could not enable the PHY interrupt? 2017-05-17 10:07:09 -06:00
Sebastien Lorquet
2c6ea23aee STM32 Ethernet: Add support for KSZ8081 PHY interrupts. 2017-05-17 10:04:49 -06:00
Juha Niskanen
8896f91f53 STM32L4: remove duplicate USART selects from Kconfig 2017-05-17 08:05:24 -06:00
Jussi Kivilinna
9169ff6a15 stm32_serial: fix freezing serial port. Serial interrupt enable/disable functions do not disable interrupts and can freeze device when serial interrupt is received while execution is at those functions.
Trivially triggered with two or more threads write to regular syslog stream and to emergency stream. In this case, freeze happens because of mismatch of priv->ie (TXEIE == 0) and actually enabled interrupts in USART registers (TXEIE == 1), which leads to unhandled TXE interrupt
and causes interrupt storm for USART.
2017-05-17 06:50:46 -06:00
Lederhilger Martin
b8e7d5c455 I had the problem that the transmit FIFO size (= actual elements in FIFO) was slowly increasing over time, and was full after a few hours.
The reason was that the code hit the line "canerr("ERROR: No available mailbox\n");" in stm32_cansend, so can_xmit thinks it has sent the packet to the hardware, but actually has not. Therefore the transmit interrupt never happens which would call can_txdone, and so the size of the FIFO size does not decrease.

The reason why the code actually hit the mentioned line above, is because stm32can_txready uses a different (incomplete) condition than stm32can_send to determine if the mailbox can be used for sending, and thus can_xmit forwards the packet to stm32can_send. stm32can_txready considered mailboxes OK for sending if the mailbox was empty, but did not consider that mailboxes may not yet be used if the request completed bit is set - stm32can_txinterrupt has to process these mailboxes first.

Note that I have also modified stm32can_txinterrupt - I removed the if condition, because the CAN controller retries to send the packet until it succeeds. Also if the condition would not evaluate to true, can_txdone would not be called and the FIFO size would not decrease also.
2017-05-16 07:47:18 -06:00
Gregory Nutt
b0fda33e13 Kconfig: Rename CONFIG_ARM_TOOLCHAIN_IAR to CONFIG_ARCH_TOOLCHAIN_IAR 2017-05-13 16:01:38 -06:00
Gregory Nutt
27805315f4 Tiva I2C: Correct an in conditional compilation 2017-05-13 14:01:42 -06:00
Gregory Nutt
6e4918c557 Remove CONFIG_ARM_TOOLCHAIN_GNU; replace with CONFIG_ARCH_TOOLCHAIN_GNU 2017-05-13 13:28:15 -06:00
Gregory Nutt
7fe112fe4c Kconfig/deconfigs: Add CONFIG_ARCH_TOOLCHAIN_GNU to indicate that the toolchain is based on GNU gcc/as/ld. This is in addition to the CPU-specific versions of the same definition. 2017-05-13 11:44:12 -06:00
Gwenhael Goavec-Merou
02535be36a STM32F410. Add support for STM32Fr10. STM32F410 is a version of STM32F4 with 32 KB of RAM and 62 or 128 KB of flash. 2017-05-13 08:40:09 -06:00
David Sidrane
c4a2e1399b Merged in david_s5/nuttx/upstream_kinetis (pull request #368)
kinetis:K66 GPIO and pin mux cleanup

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-05-13 10:37:20 +00:00
David Sidrane
69a8aecbc8 kinetis:K66 define ALT1 to match ref manual 2017-05-12 17:21:54 -10:00
David Sidrane
700e4ff5b6 kinetis:K66 fixed TMP2_CH1 definition 2017-05-12 17:03:27 -10:00
Alan Carvalho de Assis
853d332b6c Move CAN subsystem to its own directory and put device drivers there
Signed-off-by: Alan Carvalho de Assis <acassis@gmail.com>
2017-05-12 11:48:47 -03:00
Juha Niskanen
46851b33b2 STM32L4: port stm32l4_serial_get_uart function from STM32F7 2017-05-12 15:54:48 +03:00
Gregory Nutt
0de294a586 Fix lots of occurrences of 'the the', 'the there', 'the these', 'the then', 'the they. 2017-05-11 13:35:56 -06:00
Gregory Nutt
3091050963 STM32L4: Review of last PR + Move separate stm32l4_flash.h; move hardware-specific definitions to chip/stm32l4_flash.h 2017-05-11 06:58:39 -06:00
Juha Niskanen
c74a51f789 STM32L4: add internal flash write support 2017-05-11 14:35:27 +03:00
Juha Niskanen
4f18b40429 mtd/config: erase block between block read and write 2017-05-10 08:25:39 -06:00
Juha Niskanen
e04ea9e3e3 Merged in juniskane/nuttx_stm32l4/stm32l4_dbgmcu_pr (pull request #361)
STM32L4: add dbgmcu header files

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-05-09 17:06:32 +00:00
Gregory Nutt
3d73a04259 Merged l432kc into master 2017-05-09 11:03:42 -06:00
Gregory Nutt
2043e1a114 IOBs: Move from driver/iob to a better location in mm/iob 2017-05-09 07:35:30 -06:00
Juha Niskanen
ce1ad33289 STM32L4: add dbgmcu header files 2017-05-09 14:13:51 +03:00
Sebastien Lorquet
d591d3ac4e Restore settings for UARTs 4 and 5 2017-05-09 11:38:14 +02:00
Sebastien Lorquet
5204f19e4f fix typo found by Juha during review 2017-05-09 11:32:16 +02:00
Sebastien Lorquet
c1cf1269c7 Adapt stm32l43x pin definitions 2017-05-09 10:58:04 +02:00
David Sidrane
014b69e120 removed stray paren. 2017-05-08 22:56:05 +00:00
David Sidrane
8406b40baa Merged in david_s5/nuttx-16/david_s5/stm32serial-dma-buffer-round-off-not-up-1494258804216 (pull request #357)
stm32:Serial DMA buffer round off not up

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-05-08 20:32:44 +00:00
Gregory Nutt
aa11d637a8 STM32 TIM: Add method to get timer width. Freerun timer: Use timer width to get the correct clock rollover point. 2017-05-08 12:33:15 -06:00
David Sidrane
546e7acb99 stm32:Serial DMA buffer round off not up 2017-05-08 15:54:03 +00:00
David Sidrane
b8ef079951 stm32:stm32_serial Forgot the -1 on mask 2017-05-08 03:43:36 +00:00
David Sidrane
0b2fb5a396 Merged in david_s5/nuttx/upstream_stm_dma (pull request #355)
stm32: serial Allow configuring Rx DMA buffer size

Approved-by: Gregory Nutt <gnutt@nuttx.org>
2017-05-06 17:49:48 +00:00
David Sidrane
b62ef579c8 stm32: serial Allow configuring Rx DMA buffer size 2017-05-06 05:16:21 -10:00