Commit Graph

92 Commits

Author SHA1 Message Date
shanggl f6591bab48 临时提交,内容有用但是尚未排除i2c bug 2022-11-05 21:34:48 +08:00
shanggl 4cf1fd3a1d fix bug : 解决i2c 一直忙问题, 修正气压计无读数bug 修正ci gcc version ,10.3.1 导致pg 数据错误 2022-10-23 22:52:49 +08:00
shanggl 554931b207 msc ready 2022-10-01 23:01:17 +08:00
shanggl 468c867a82 add AT32F435 RGT7 1024kb LQFP64 support 2022-10-01 23:01:15 +08:00
shanggl fac77f9efe add proto2 hardware defines 2022-10-01 23:01:12 +08:00
shanggl 8b2eaca723 compile pass 2022-10-01 22:57:31 +08:00
shanggl 83896ee959 校对at32f437 gpio timer gpiomuxid 2022-10-01 22:55:18 +08:00
shanggl f0d810b782 fix io rcc exti nvic ,led on success 2022-10-01 22:41:05 +08:00
shanggl 7d0317ade1 io rcc exti ready 2022-10-01 22:41:04 +08:00
shanggl 7b03a9965a system init reset systick ready 2022-10-01 22:26:28 +08:00
shanggl 3c997e3431 port to at32f437 base line 2022-10-01 22:26:26 +08:00
shanggl 00f6e169f7 fix 240Mhz 2022-10-01 22:26:24 +08:00
shanggl c48e56f753 可以编译了,剩下的adc 、pwm_dshot.c dshot_bitbang 这几个需要调试,内存需要扩展到224k,调整PLL时钟等 2022-10-01 22:25:15 +08:00
shanggl 27d0b54d4f PORT TO AT32F403A STEP 1 2022-10-01 22:25:13 +08:00
Dominic Clifton a325e2386d STM32H730 - Initial ST32H730 support.
The H730 is a value-line CPU, similar to the H723/H725, but with only
128kb RAM.

The FC firmware code is designed to RUN from external flash in MEMORY
MAPPED mode, via OctoSPI.  Use of ITCM/DTCM advised for core loops, like
PID control.

A bootloader is required to enable memory-mapped mode and jump to the
firmware, similar to how EXST bootloader system works.

Config storage is not part of this commit and is a problem when using a
single flash chip in memory mapped mode because the CPU can't run
read/write routines from the flash chip while writing to the flash chip.
Until flash read/write routines are updated the solution requires either
a second flash chip on an SPI interface, or the use of an SD card for
config storage.

Additional commits will support read/write of config to the code/data
storage flash chip to enable cheap and space efficient single-flash-chip
FC solutions.

Squashed commits:
STM32H730 - Workaround issue with 2GB `.elf` files being created.
STM32H730 - Reduce firmware size to 1MB.
STM32H730 - Add USB HS configuration.
STM32H730 - Add ADC internal tag mappings.
STM32H730 - Update all ADC mappings based on the referenced ST
documentation.  Add the VBAT channels.
STM32H730 - Fix DMA continuous requests.
STM32H730 - Fix ADC_INTERNAL confusion.
STM32H730/G4 - Disambiguate use of ADC_CHANNEL_INTERNAL_FIRST_ID.
STM32H730 - Fix documentation reference.
STM32H730 - Add DMA request mapping for ADC3.
STM32H730 - Explicitly set the ADC clock.
STM32H730 - Configure PLL2 speeds correctly.

* Tested with Ultrafast 64GB SanDisk SDXC card.

STM32H730 - Use 50Mhz clock for SDXC cards.

* Tested with SanDisk Ultra 64GB.  100Mhz clock gave CRC errors.

STM32H730 - Ensure USB has a lower NVIC priority than the SDMMC card
reads.

If it's higher, 0, then the SDMMC's DMA IRQ handler doesn't get called
when handing USB MSC storage reads.

STM32H730 - Support CPU name in CLI.

STM32H730 - Rebuild when linker scripts changes.
2021-12-23 15:02:23 +01:00
Steve Evans ab66795eeb G4 SPI DMA support 2021-08-31 23:29:51 +12:00
Steve Evans 87c8847c13 New SPI API supporting DMA
Call targetConfiguration() once before config is loaded and again afterwards in case the config needs to be changed to load from SD card etc

Drop SPI clock during binding

Remove debug

Add per device SPI DMA enable

Fix sdioPinConfigure() declaration warning

Reduce clock speed during SPI RX initialisation
2021-07-25 12:40:25 +12:00
Hans Christian Olaussen 5c7ff1ff94 I2C configurable clockspeed 2021-05-17 13:57:44 +02:00
mikeller 03d3d94497 Added Unified Target for STM32G4. 2021-04-26 16:18:28 +12:00
jflyper 1feb306674 [H7] H723/H725 support 2020-11-11 23:45:15 +09:00
Michael Keller 4bf3e99e9c
Merge pull request #10318 from jflyper/bfdev-h7-h7a3
[H7] H7A3 support
2020-11-05 02:11:20 +13:00
jflyper 697d0f7ed3 [H7] H7A3 support 2020-11-01 00:32:39 +09:00
Steve Evans 31b06cd7d2 Add USB MSC support for H7 2020-10-30 19:30:38 +00:00
Michael Keller a54e31a06a Changed optimisation on F7X2 targets to '-O2' to save flash space. 2020-10-19 09:10:43 +02:00
Unknown 5bf4f71a6d Initial install of GHST driver
First pass at GHST driver including low-latency control, and basic telemetry.

Fix Ghost channel scaling

Use ghstChannelData instead of rxRuntimeState->channelData

Integrate PR feedback

Primarily de-tab and a few cosmetic changes.

Keep Travis CI happy

Removed unused function

Rework ghost driver to reduce time in ISR, move processing

As requested in PR review.
Fixed issue in telemetry driver, mAh consumed is transmitted as units of 10mAh, not 1mAh.

Resolve Packet Collision Issue with GHST

Send telemetry packets only within a well defined time slot after an incoming Rx packet.

Remove unnecessary comment

rxRefreshRate doesn't need to be dynamic.

Ghost - Remove special case from scheduler

No need to reschedule telemetry for the Ghost protocol.
2020-10-14 21:52:33 +13:00
Michael Keller 5f8d9da384
Merge pull request #10224 from jflyper/bdev-h7-bbdshot
[H7] BB-Dshot support (TIM1/TIM8 limited version)
2020-10-05 00:28:34 +13:00
jflyper fe1a05fa2a [H7] BB-Dshot support (TIM1/TIM8 limited version) 2020-09-30 23:27:23 +09:00
jflyper e4d7c4e152 [G4][SYSTEM] Basic & build files 2020-09-30 18:20:05 +09:00
Dominic Clifton 09ac5be8d6 Cleanup and de-duplicate H7 linker scripts 2020-03-26 16:50:21 +01:00
Dominic Clifton fb6f93bc0d Remove 'flash' from the ram-based linker script filename. 2020-03-26 16:37:00 +01:00
jflyper ec2aac314d [I2C] Introduce computational I2C waveform configuration for HAL based MCUs
Tested with
Nucleo-F722ZE I2C1 on PB8,PB9
Nucleo-H743ZI I2C1 on PB8,PB9 and I2C4 on PF14,PF15
2020-03-10 12:11:50 +09:00
jflyper be923434b8 Rename FLASH_SIZE to TARGET_FLASH_SIZE 2020-01-20 12:30:28 +09:00
Bruce Luckcuck 04844bd5a1 Refactor common USB MSC code and improve activity LED
Eliminated the duplicated MSC functions in the architecture specific files and moved to a shared common.

Improved the activity indicating LED and made it consistent between onboard flash and sd card mass storage mode.
2019-12-02 22:08:19 -05:00
mikeller 11b3ba224c Moved MCU specific defines into 'common_pre.h' if not used in the STM32 libraries. 2019-10-27 23:09:33 +13:00
jflyper adf6fd1764 DMA bit banging Dshot, first cut
F405 working (OMNIBUSF4SD target)
F411 not tested
F722 working, needs testing (OMNINXT7 target)
F74x not working

NOX target (temporary)

bb_dshot with telemetry on f4
bbshot f7 targets and fix crash due to missing debug pins

remove empty line

add empty lines

remove OMNIBUSF4 specific debug pins

add missing comma

add missing comma

Use separate bbTimerHardware array to fix unified targets

eliminate now unneeded timerGetByUsage

don't duplicate timer1 def

Add auto mode, rename dshot_bbshot to dshot_bitbang

remove newline

renamve various files

various changes to address feedback

address feedback

address feedback

add pacer timers to timer show

don't disable telemetry if dshot_bitbang is on or auto

Address feedback, add faster decode implementation based on bit banding, modify dma parameters to reduce required memory bandwidth on half

remove debug output

remove NOINLINE

Protect gpio direction change with critical sections

FIXWS_SAVE_INDEX

add static back in

no forward typedef

address review feedback

disallow proshot1000 with dshot bitbang

Extracted and plumbed up 'dbgPin'.
2019-09-04 16:06:48 +12:00
jflyper 0780d1919c [H7] LL-Dshot support with DShot GCR telemetry 2019-08-17 02:11:48 +09:00
jflyper ff759034f3 Refactor (consolidation and separation of stdperiph and hal) 2019-08-02 04:11:22 +09:00
mikeller 1c60776487 Added target variant NUCLEOH743_RAMCONFIG to get CI coverage of 'EXST' changes.
Changing over to be RAM based.

Changes required for MPU configuration service.

Added documentation.
2019-07-27 18:20:05 +12:00
jflyper 7225aadb7d Move MAX_MPU_REGIONS into STM32H7.mk where EXST is visible 2019-07-24 17:16:34 +09:00
jflyper c8252fabdd Introduce memProtXXX MPU configuration service 2019-07-24 11:32:11 +09:00
jflyper d924e59c3c [H7][LIB][SDMMC] Workaround for SDMMC Errata 2.11.4
Application of

STM32H750 - Apply workaround to the SDMMC Errata 2.11.4 (8446832)

to V1.4.0
2019-07-08 09:30:55 +09:00
jflyper 400a122f30 [H7] STM32H7.mk additions and cleanup 2019-07-08 09:30:21 +09:00
Michael Keller 9b04b5ebd7
H7 build script updates (#8492)
H7 build script updates
2019-06-28 19:23:20 +12:00
Dominic Clifton 0c7b161c32 STM32H750 - Allow targets to override TARGET_FLASH. 2019-06-27 02:57:55 +02:00
Dominic Clifton aea8733e4f STM32H7 - Allow targets to override linker script. 2019-06-27 02:57:55 +02:00
Dominic Clifton 05c518847d [H7] Relocate startup files to match betaflight/master branch 2019-06-26 12:36:57 +02:00
jflyper dad1110181 [H7] Relocate LD files to match betaflight/master branch 2019-06-26 12:36:34 +02:00
Dominic Clifton e81d11049f Fix F1/F3 OPBL targets using wrong linker script. 2019-06-09 19:04:39 +02:00
Dominic Clifton 0632eeb934 Support compilation of EXST (EXTERNAL STORAGE) targets
- Initial

- Adjust load address of EXST firmware.

- Add helper script to pad an EXST binary to the expected size.

Padded firmware currently required due to a bug in the flash/dfu code
which causes anything less than a flash page size to be truncated when
uploading new firmware via the bootloader DFU.

- Minor linker script cleanups.

- STM32H7.mk change hardcoded TARGET_FLASH (384) to FIRMWARE_SIZE

- Delete unused configuration section entries from linker
scripts.

- Increase EXST firmware size to 448K.
It turns out 384K wasn't enough for a feature-complete firmware.

- Update pad-exst.sh to use 448K by default.

- Move the EXST file generation to the makefile.

[EXST] Embed firmware hash in ELF

- Add debug marker at end of CODE_RAM section.

It was found when transferring firmware to the H7 RAM via a BMP probe
using the 'gdb load' command, that the last few bytes were not
transferred, this debug marker is present to ensure all needed parts of
the firmware are present.

Example memory view of corrupted bytes at end of transfer:
0x2407DFAE  DEB90000 DEB9DEB9 DEB9DEB9 DEB9DEB9  ..¹Þ¹Þ¹Þ¹Þ¹Þ¹Þ¹Þ
0x2407DFBE  000000B9 00000000 00000000 00000000  ¹...............

should be:
0x2407DFAE  DEB9DEB9 DEB9DEB9 DEB9DEB9 DEB9DEB9  ¹Þ¹Þ¹Þ¹Þ¹Þ¹Þ¹Þ¹Þ
0x2407DFBE  00000000 00000000 00000000 00000000  ................

- Remove debug marker in EXST firmware.

STM32H750_EXST - Provide space for empty hash.

* Bootloader will run firmware if hash is empty, without re-verifying
RAM content against hash.
* CODE_RAM always shows as 100% usage.

STM32H750_EXST - Use a specific ELF section for a hash.

Two benefits:
1) CODE_RAM no-longer shows 100% full, since it is no-longer
padded/filled.
2) Prepares the code so that objcopy can be used to inject the hash
into the ELF.

STM32H750_EXST - Patch MD5 into ELF.

Process is now as follows.

* Binary generated (via make target dependency) so there is something to
hash.
* Binary copied (and padded).
* MD5 Hash computed.
* xxd patch file generated from hash.
* xxd hash patch applied to copy of binary at correct address.
* elf .exst_hash section dumped.
* hash injected into into dumped section.
* elf .exst_hash section updated with updated dumped section.

Replace EXST with USE_EXST.

Add documentation for the EXST firmware format.

Add table formatting to EXST documentation.

Update bootloader block.

Update H750 EXST linker script to use block format 0x00.

Use .exst.elf and .exst.bin on the exst files.

Add 'no checksum' to list of checksum hash methods.

Update EXST build system so it generates the following sets of files

obj/main/betaflight_TARGET.elf
obj/main/betaflight_TARGET.map
obj/main/betaflight_TARGET_EXST.elf
obj/betaflight_VERSION_TARGET.bin
obj/betaflight_VERSION_TARGET.bin.md5
obj/betaflight_VERSION_TARGET_EXST.bin

Update EXST build system to be more user-friendly.

* user-flashable files are generated in the normal place.
* Intermediate files are generated in `obj/main/...`
* Removes the `exst` goal.
* Adds .hex generation for EXST builds based on the patched .elf.

To build EXST targets, simply use `make TARGET=x` as normal and flash
the resulting `.hex/.bin` files rather than the .exst.bin file.

Developers can use either the `.elf` or patched `_EXST.elf` file as is
appropriate for their needs.

EXST documentation updated to match changes to build system.
2019-06-07 09:14:49 +12:00
jflyper 6beeca38c3 Consolidate F7 and H7 VCP HAL code except usbd_conf.c 2019-06-01 11:57:50 +09:00