aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* lpc176x: Use FIOPIN to set start value on gpio_out_reset()Kevin O'Connor2019-09-291-4/+1
| | | | | | | | The FIOSET and FIOCLR registers may not set an initial value if the pin is not in an output mode. So, use FIOPIN to set the initial value. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Only prompt for a bootloader on stm32f103 and stm32f407Kevin O'Connor2019-09-181-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: No need to call SystemInit() from main()Kevin O'Connor2019-09-181-2/+1
| | | | | | The SystemInit() is already called from armcm_boot.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_boot: Export MCU definition from armcm_bootKevin O'Connor2019-09-186-16/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_reset: Add a new helper file defining command_reset()Kevin O'Connor2019-09-187-26/+21
| | | | | | Add a generic ARM Cortex-M implementation of the "reset" command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Move VTOR fixup from main() to chip specific codeKevin O'Connor2019-09-183-3/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Move usb_request_bootloader() to chip specific codeKevin O'Connor2019-09-184-20/+24
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix usbfs rx buffer sizingKevin O'Connor2019-09-161-2/+2
| | | | | | | | | The usbfs receive buffers must also have space for the 2 byte crc at the end of a transmission. This fixes an error that could lead to lost messages from mcu to host (resulting in bytes_invalid increasing in stats) on the stm32f103. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Use official defines for EPR bitsKevin O'Connor2019-09-161-30/+23
| | | | | | Use the standard definitions for the endpoint register bits. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Rename USB_BTABLE to EPM in usbfs.cKevin O'Connor2019-09-161-20/+20
| | | | | | | Rename the internal definition so it isn't in conflict with the USB_BTABLE register. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Add missing PB21 pin to ADC moduleKevin O'Connor2019-09-161-1/+1
| | | | | | Reported by @mental405. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Disable usb irqs in usbotg handlersKevin O'Connor2019-09-121-17/+56
| | | | | | | | It appears the usbotg controller can get confused if the usb irq handler runs while processing a usb request. Disable usb irqs during usb processing to avoid this. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Enable flash loop caching optimization on sam4sKevin O'Connor2019-09-081-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Rework usbotg transmit interruptsKevin O'Connor2019-09-081-7/+10
| | | | | | | | Use the XFRC interrupt instead of TXFE. Don't mask/unmask the tx interrupts during runtime. This fixes some race conditions where a tx notification may have previously gotten lost. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for SPI3 bus on alternate PC11,PC12,PC10 pinsKevin O'Connor2019-09-051-1/+8
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* tmcuart: Fix typo in function nameKevin O'Connor2019-09-011-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for SPI1 and SPI3 bussesKevin O'Connor2019-08-312-13/+35
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Fix gpio enumerations (each bank has 16 pins, not 32)Kevin O'Connor2019-08-311-9/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Work around stm32f407 usbotg chip errataKevin O'Connor2019-08-311-3/+10
| | | | | | | It appears bogus entries can get placed on the rxqueue - detect and clear them. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Configure and enable usbotg endpoint0 during setupKevin O'Connor2019-08-301-25/+10
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Disable and flush usbotg bulk transmit pipe on usb_set_configure()Kevin O'Connor2019-08-301-19/+11
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Perform usbotg endpoint init during usb_set_configure()Kevin O'Connor2019-08-301-26/+26
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Discard usbotg tx data until usb is readyKevin O'Connor2019-08-301-2/+2
| | | | | | If the usb interface is not ready, just discard messages. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: No need to clear the usbotg address on resetKevin O'Connor2019-08-301-4/+2
| | | | | | The controller automatically clears the address. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Enable usbotg bulk reads during endpoint configurationKevin O'Connor2019-08-301-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: ADC pins need to be in input mode with pullups disabledKevin O'Connor2019-08-281-0/+3
| | | | | | | | | | The ADC pins (on at least the sam3x8e) need to be configured in input mode with the internal pullups disabled in order to get accurate ADC readings. Reported by @bryanboettcher. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* buildcommands: Match DECL_X names to the actual C macro namesKevin O'Connor2019-08-221-6/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_link: Rename armcm_boot.lds.S to armcm_link.lds.SKevin O'Connor2019-08-226-9/+9
| | | | | | | Rename the linker script so the build does not have any conflicts with the armcm_boot.d dependency file. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ctr: Encode negative integers in normal hex notationKevin O'Connor2019-08-221-1/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Allow count parameter of DECL_ENUMERATION_RANGE() to be an expressionKevin O'Connor2019-08-221-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ctr: Add support for multiple integers in DECL_CTR_INTKevin O'Connor2019-08-223-20/+24
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ctr: Encode integers in hexKevin O'Connor2019-08-221-6/+9
| | | | | | | Replace the custom encoding with a hex encoding. This makes it a little easier to inspect the CTR conversions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Translate null characters to newline characters in ctr requestsKevin O'Connor2019-08-221-2/+2
| | | | | | | | Store the CTR requests in compile_time_request.txt with the null characters removed. This makes it slightly easier to inspect the CTR conversions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Update code to use armcm_boot mechanismKevin O'Connor2019-08-229-41/+37
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Move irq handler code above irq setupKevin O'Connor2019-08-223-75/+80
| | | | | | Only code movement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Update code to use armcm_boot mechanismKevin O'Connor2019-08-225-46/+56
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsam: Move irq handler code above irq setupKevin O'Connor2019-08-223-65/+65
| | | | | | Only code movement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Update code to use armcm_boot mechanismKevin O'Connor2019-08-227-129/+28
| | | | | | | Replace the custom linker scripts with the src/generic/armcm_boot.c mechanism. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* atsamd: Move irq handler code above irq setupKevin O'Connor2019-08-223-85/+90
| | | | | | Only code movement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Update code to use armcm_boot mechanismKevin O'Connor2019-08-227-111/+24
| | | | | | | Replace the stm32 provided assembler with the src/generic/armcm_boot.c mechanism. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Move irq handler code above irq setupKevin O'Connor2019-08-223-88/+88
| | | | | | Only code movement. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_boot: Add generic code for early board init on armcm machinesKevin O'Connor2019-08-224-0/+158
| | | | | | | | Add basic ARM Cortex-M C init code and build linker scripts to src/generic/ code. This can be used to simplify the various ARM board code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Makefile: Add generic rule for precompiling linker scriptsKevin O'Connor2019-08-212-18/+8
| | | | | | | Add a general build rule to precompile *.lds.S files to *.ld files. Remove the custom rules in src/atsamd/Makefile and src/stm32/Makefile. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* armcm_timer: Fix typo in comment in armcm_timer.hKevin O'Connor2019-08-211-1/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Initial support for i2cKevin O'Connor2019-08-204-0/+138
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for configuring open drain output modeKevin O'Connor2019-08-203-2/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Make sure to enable the gpio clock prior to setting the first valueKevin O'Connor2019-08-204-4/+22
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* spi_software: Remove unused include fileKevin O'Connor2019-08-171-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Simplify usbotg packet reading and writingKevin O'Connor2019-08-161-57/+54
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* stm32: Add support for additional ADC3 ports on stm32f4Kevin O'Connor2019-08-152-20/+42
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>