Code Monkey home page Code Monkey logo

chibios-contrib's Introduction

*****************************************************************************
*** Files Organization                                                    ***
*****************************************************************************

--{root}                        - ChibiOS directory.
  +--readme.txt                 - This file.
  +--documentation.html         - Shortcut to the web documentation page.
  +--license.txt                - GPL license text.
  +--demos/                     - Demo projects, one directory per platform.
  +--docs/                      - Documentation.
  |  +--common/                 - Documentation common build resources.
  |  +--hal/                    - Builders for HAL.
  |  +--nil/                    - Builders for NIL.
  |  +--rt/                     - Builders for RT.
  +--ext/                       - External libraries, not part of ChibiOS.
  +--os/                        - ChibiOS components.
  |  +--common/                 - Shared OS modules.
  |  |  +--abstractions/        - API emulator wrappers.
  |  |  |  +--cmsis_os/         - CMSIS OS emulation layer for RT.
  |  |  |  +--nasa_osal/        - NASA Operating System Abstraction Layer.
  |  |  +--ext/                 - Vendor files used by the OS.
  |  |  +--ports/               - RTOS ports usable by both RT and NIL.
  |  |  +--startup/             - Startup support.
  |  +--ex/                     - EX component.
  |  |  +--dox/                 - EX documentation resources.
  |  |  +--include/             - EX header files.
  |  |  +--devices /            - EX complex drivers.
  |  +--hal/                    - HAL component.
  |  |  +--boards/              - HAL board support files.
  |  |  +--dox/                 - HAL documentation resources.
  |  |  +--include/             - HAL high level headers.
  |  |  +--lib/                 - HAL libraries.
  |  |  |  +--complex/          - HAL collection of complex drivers.
  |  |  |  |  +--mfs/           - HAL managed flash storage driver.
  |  |  |  |  +--serial_nor/    - HAL managed flash storage driver.
  |  |  |  +--fallback/         - HAL fall back software drivers.
  |  |  |  +--peripherals/      - HAL peripherals interfaces.
  |  |  |  +--streams/          - HAL streams.
  |  |  +--osal/                - HAL OSAL implementations.
  |  |  |  +--lib/              - HAL OSAL common modules.
  |  |  +--src/                 - HAL high level source.
  |  |  +--ports/               - HAL ports.
  |  |  +--templates/           - HAL driver template files.
  |  |     +--osal/             - HAL OSAL templates.
  |  +--oslib/                  - RTOS modules usable by both RT and NIL.
  |  |  +--include/             - OSLIB high level headers.
  |  |  +--src/                 - OSLIB high level source.
  |  |  +--templates/           - OSLIB configuration template files.
  |  +--nil/                    - NIL RTOS component.
  |  |  +--dox/                 - NIL documentation resources.
  |  |  +--include/             - NIL high level headers.
  |  |  +--src/                 - NIL high level source.
  |  |  +--templates/           - NIL configuration template files.
  |  +--rt/                     - RT RTOS component.
  |  |  +--dox/                 - RT documentation resources.
  |  |  +--include/             - RT high level headers.
  |  |  +--src/                 - RT high level source.
  |  |  +--templates/           - RT configuration template files.
  |  +--various/                - Various portable support files.
  +--test/                      - Kernel test suite source code.
  |  +--lib/                    - Portable test engine.
  |  +--hal/                    - HAL test suites.
  |  |  +--testbuild/           - HAL build test and MISRA check.
  |  +--nil/                    - NIL test suites.
  |  |  +--testbuild/           - NIL build test and MISRA check.
  |  +--rt/                     - RT test suites.
  |  |  +--testbuild/           - RT build test and MISRA check.
  |  |  +--coverage/            - RT code coverage project.
  +--testex/                    - EX integration test demos.
  +--testhal/                   - HAL integration test demos.

*****************************************************************************
*** Releases and Change Log                                               ***
*****************************************************************************

*** Next ***
- NEW: Added STM32 FDCANv2 for STM32H7xx
- NEW: Now RT virtual timers can recalculate the value of CH_CFG_ST_TIMEDELTA
       at runtime and continue using the recalculated value. This has two
       consequences: 1) The value is recalculated once 2) it is possible
       to use the new API chVTGetCurrentDelta() and update the static
       setting in order to avoid recalculation.
- NEW: OSLIB release methods now return the value of the reference counter.
- NEW: Support for STM32C0xx.
- NEW: Improved DAC driver, updated STM32 DACv1.
- NEW: STM32 RTCv2 and RTCv3 modified to not use shadow registers.
- NEW: Enhanced STM32F7xx MPU configuration in mcuconf.h.
- NEW: I2C slave support in HAL high level driver.
- NEW: Added settings for STM32 OCTOSPIv1 and OCTOSPIv2 TCR bits SSHIFT and
       DHQC.
- NEW: Automatic removal of duplicated inclusion paths on make command lines.
- NEW: Reworked STM32 SDMMCv1 and SDMMCv2 drivers, better timeout and clock
       handling, improved speed for aligned buffers.
- NEW: Added a "waend" field to the thread structure in RT for debug
       convenience.
- NEW: Added a para-virtualized HAL port for use in sandboxes.
- NEW: Added a VIO subsystem to sandboxes supporting drivers
       para-virtualization, PAL and SIO supported so far.
- NEW: Added and RT port for use in virtualized sandboxes.
- NEW: Added full virtualization support to sandboxes with a virtual IRQ
       mechanism.
- NEW: Added __CH_OWNEROF() macro to RT.
- NEW: Added a Posix-favored shell named "msh" (Mini Shell). The shell is able
       to run sub-apps inside the same sandbox. The shell can either be placed
       statically in flash or loaded dynamically in RAM.
- NEW: Added runnable "apps" capability to SBs, apps available so far: msh, ls.
- NEW: Added ability to load ELF files to SBs.
- NEW: Enhanced Posix API for SBs leveraging the VFS integration.
- NEW: SBs and VFS integration. Each SB can see its own VFS instance.
- NEW: Added integration of LittleFS on top of our flash infrastructure.
- NEW: Added a new MEM_IS_VALID_FUNCTION() macro to RT and NIL.
- NEW: Changed SB configuration options names to be prefixed with SB_CFG_.
- NEW: Added a new CH_CFG_HARDENING_LEVEL option to RT.
- NEW: Added a chXXXDispose() function to all objects in NIL.
- NEW: Added a chXXXDispose() function to all objects in RT.
- NEW: Added VFS-related commands to the shell, disabled by default.
- NEW: Added a new VFS subsystem (Virtual File System), it allows to assemble
       trees of files from multiple "File System Drivers" into a single tree
       and access it as a whole.
- NEW: Added MEM_NATURAL_ALIGN macro to RT and NIL.
- NEW: Added static initializer for virtual timers in RT.
- NEW: Added new function chHeapIntegrityCheck().
- NEW: Function chCoreGetStatusX() changed to return a memory region object
       instead of a simple size.
- NEW: RT and NIL upgraded to support the enhanced OSLIB.
- NEW: Memory areas/pointers checker functions added to OSLIB.
- FIX: Fixed ARMv8-M-ML port compile fail when FPU is enabled (bug #1281)
       (backported to 21.11.4).
- FIX: Fixed interrupts not enabled for STM32H735 TIM15, TIM16 and TIM17
       (bug #1280)(backported to 21.11.4).
- FIX: Fixed wrong STM32 LSI activation check (bug #1279)
       (backported to 21.11.4).
- FIX: Fixed STM32 HAL UART ISR flaw (bug #1278)(backported to 21.11.4).
- FIX: Fixed race condition caused by chGuardedPoolAllocI() (bug #1277)
       (backported to 20.3.5)(backported to 21.11.4).
- FIX: Fixed avoid shadowing with build-in pow10 function in chprintf.c
       (bug #1274)(backported to 20.3.5)(backported to 21.11.4).
- FIX: Fixed enabling PWM on TIM1, 3, 4 causes compile errors in
       RT-STM32G0B1RE-NUCLEO64 (bug #1273)(backported to 21.11.4).
- FIX: Wrong assertion in STM32 SPIv3 on SPI6 start.
- FIX: Fixed problems related to TIM3, TIM4 and TIM16 on STM32G0.
- FIX: Fixed uninitialized return message in EX subsystem (bug #1267)
       (backported to 21.11.4).
- FIX: Fixed unnecessary code in SNOR device drivers (bug #1265)
       (backported to 20.3.5)(backported to 21.11.4).
- FIX: Fixed RP2040 HAL GPIO failed to compile (bug #1264)
       (backported to 21.11.4).
- FIX: Fixed channel 0 corruption on STM32 BDMAv1 (bug #1263)
       (backported to 20.3.5)(backported to 21.11.4).
- FIX: Fixed wrong statistics in RT7 (bug #1262)(backported to 21.11.4).
- FIX: Fixed missing cache management during Cortex-M RAM initializations
       (bug #1261)(backported to 20.3.5)(backported to 21.11.4).
- FIX: Fixed RTC & TAMP interrupts not functional (bug #1260)
       (backported to 21.11.4).
- FIX: Fixed syntax errors in STM32H7xx/hal_lld_type2.h (bug #1259)
       (backported to 21.11.4).
- FIX: Fixed unwanted reset of cache on STM32H7xx (bug #1258)
       (backported to 20.3.5)(backported to 21.11.4).
- FIX: Fixed invalid HSIDIV in STM32Ggxx clocks initialization (bug #1257)
       (backported to 21.11.4).
- FIX: Fixed incorrect RTC initialization on STM32G4/L4/L4+ (bug #1256)
       (backported to 20.3.5)(backported to 21.11.4).
- FIX: Fixed syntax error in RP2040 GPIO driver (bug #1255)
       (backported to 21.11.4).
- FIX: Fixed undefined STM32_SDMMC_MAXCLK value for STM32H7 type 1 and 2
       (bug #1254)(backported to 21.11.4).
- FIX: Fixed invalid checks on PLLP/R/Q dividers on STM32H7 (bug #1253)
       (backported to 20.3.5)(backported to 21.11.4).
- FIX: Fixed remote wakeup failure in STM32 OTGv1 driver (bug #1252)
       (backported to 20.3.5)(backported to 21.11.4).
- FIX: Fixed wrong use of hooks in RT/NIL (bug #1251)
       (backported to 20.3.5)(backported to 21.11.4).
- FIX: Fixed SPI_MMC driver broken in 21.11.3 (bug #1249)
       (backported to 21.11.3).
- FIX: Fixed broken support for STM32 UART9 and USART10 (bug #1248)
       (backported to 21.11.3).
- FIX: Fixed wrong initialization in STM32L1xx ADC driver (bug #1247)
       (backported to 20.3.5)(backported to 21.11.3).
- FIX: Fixed wrong HSI48 support on STM32L0xx (bug #1246)
       (backported to 20.3.5)(backported to 21.11.3).
- FIX: Fixed wrong DMA definitions for STM32L0xx I2C3 peripheral (bug #1245)
       (backported to 20.3.5)(backported to 21.11.3).
- FIX: Fixed wrong path in STM32L053 ADC demo makefile (bug #1244)
       (backported to 20.3.5)(backported to 21.11.3).
- FIX: Fixed missing semicolon in STM32 OTGv1 driver (bug #1243)
       (backported to 20.3.5)(backported to 21.11.3).
- FIX: Fixed HSI48 not enabled for STM32L496/4A6 (bug #1242)
       (backported to 20.3.5)(backported to 21.11.3).
- FIX: Fixed problem in STM32 gpt_lld_polled_delay() implementation (bug #1241)
       (backported to 20.3.5)(backported to 21.11.3).
- FIX: Fixed invalid delay loop in STM32G0/WL ADCv5 driver (bug #1240)
       (backported to 20.3.5)(backported to 21.11.3).
- FIX: Fixed STM32_MCOSEL setting problem (bug #1239).
- FIX: Fixed problems with cache in STM32 SDMMC drivers (bug #1238).
- FIX: Fixed missing clock enables for some GPIOS on some STM32L4s (bug #1237)
       (backported to 20.3.5)(backported to 21.11.3).
- FIX: Fixed old bugs in serial driver header (bug #1236)
       (backported to 20.3.5)(backported to 21.11.3).
- FIX: Fixed virtual timers lockup uder rare conditions (bug #1235)
       (backported to 20.3.5)(backported to 21.11.3).
- FIX: Fixed STM32 RTCv2 locks for a second (bug #1234)
       (backported to 20.3.5)(backported to 21.11.3).
- FIX: Fixed CAN support broken on STM32F413 (bug #1232).
- FIX: Re-opened and fixed bug #1100
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed wrong buffers toggling in STM32 USBv1 isochronous mode (bug #1232)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed STM32 RTCv2 registers synchronization errata (bug #1231)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed STM32 ADCv1 and ADCv5 do not allow prescaler divide value of 1
       (bug #1230)(backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed missing check on STM32 SPIv2 DMA settings for SPI1 (bug #1229)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed ARMv6-M port Keil compiler fail (bug #1228)
       (backported to 21.11.2).
- FIX: Fixed invalid handling of lwIP NETIF_FLAG_LINK_UP flag (bug #1227)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed missing TIM16/17 errata handling for STM32G0xx (bug #1226)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed missing ADC errata handling for STM32G0xx (bug #1225)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed problem in the HAL I2C fallback driver (bug #1224)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed GPIOH clock not enabled on STM32L432 (bug #1223)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed invalid cumulative time stat in RT (bug #1222)
       (backported to 21.11.2).
- FIX: Fixed incorrect type cast in TIME_I2US() (bug #1221)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed missing clock disable for STM32 OCTOSPI2 (bug #1220)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed wrong condition in STM32 sio_lld_read() function (bug #1219)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed STM32 Ethernet driver causes system hang after 2^31 packets
       sent/received (bug #1218)(backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed clock re-initialization problem in STM32 USARTv2 and USARTv3
       drivers (bug #1217)(backported to 21.11.2).
- FIX: Fixed assertion on initialization of STM32H7xx (bug #1216)
       (backported to 21.11.2).
- FIX: Fixed Virtual Timers failure in a specific condition (bug #1215)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed invalid STM32_OTG_STEPPING for STM32F40_41xxx (bug #1214)
       (backported to 21.11.2).
- FIX: Fixed SPIv2 driver compile fails when SPI_USE_SYNCHRONIZATION is FALSE
       (bug #1213)(backported to 21.11.2).
- FIX: Fixed invalid state transition in SNOR flash driver (bug #1212)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed missing exit condition in sioSynchronizeRX() and
       sioSynchronizeTX() (bug #1211)(backported to 21.11.2).
- FIX: Fixed missing check in chobjcaches.h (bug #1210)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed misspelled chTraceSuspendI() function name (bug #1209)
       (backported to 21.11.2).
- FIX: Fixed RT testbuild application broken (bug #1208)
       (backported to 20.3.5)(backported to 21.11.2).
- FIX: Fixed PWR_CR2_USV not set in STM32L4+ mcuconf.h file (bug #1207)
       (backported to 21.11.1).
- FIX: Fixed USB not enabled on STM32F103x6 (bug #1206)
       (backported to 20.3.5)(backported to 21.11.1).
- FIX: Fixed RT test suite build fails when CH_CFG_USE_TIMESTAMP is FALSE
       (bug #1205)(backported to 21.11.1).
- FIX: Fixed wrong number of CAN filters for STM32L496/9A6 (bug #1204)
       (backported to 20.3.5)(backported to 21.11.1).
- FIX: Fixed DMA stream not disabled in STM32 QUADSPIv1 driver (bug #1203)
       (backported to 20.3.5)(backported to 21.11.1).
- FIX: Fixed I2C4 DMA streams for STM32L496 (bug #1202)
       (backported to 20.3.5)(backported to 21.11.1).
- FIX: Fixed STM32_SDMMC2_NUMBER on STM32H7 (bug #1201)
       (backported to 20.3.5)(backported to 21.11.1).
- FIX: Fixed STM32G0B1 demo application hangs debuggers (bug #1200)
       (backported to 21.11.1).

chibios-contrib's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chibios-contrib's Issues

I get chSysHalt("SV#6") while running ChibiOS-Contrib-RT-STM32F407-DISCOVERY-RTT+SystemView Example

Hi guys

I decided to evaluate Segger J-Link, and tested the example in the ChibiOS-Contrib section

However, when I run it in the debugger; it is as if ChibiOS thinks it is running in a thread contexts it freezes at chSysHalt("SV#6")

Clearly I can see in the debugger that I am in a DMA ISR , which invokes macro CH_CFG_IRQ_PROLOGUE_HOOK() that is delegated to SEGGER_SYSVIEW_RecordEnterISR() method
Here is a picture
Selection_095

Therefore, I wonder if this is a bug, or my J-Link hardware is bad, or I did something wrong?

Many thanks in advance.

Add support for ChibiOS 18.2

Hello!

I am porting my application from Chibios 17 to 18 and I use the FSMC driver.

Problem:
The new build system catches ALLSRC and ALLINC paths for compilation. The "platform.mk" file of the contrib branch first includes the original "platform.mk" and then adds its own sources to

PLATFORMSRC
PLATFORMINC

However, these are not used by the makefile anymore.

In my instance, I could fix it by changing the variable names, to which the paths are appended, like this:

include ${CHIBIOS}/os/hal/ports/STM32/STM32F7xx/platform.mk

ALLSCR += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c \
               ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_nand_lld.c \
               ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sram.c \
               ${CHIBIOS_CONTRIB}/os/hal/src/hal_fsmc_sdram.c

ALLINC += ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD/FSMCv1 \
               ${CHIBIOS_CONTRIB}/os/hal/ports/STM32/LLD

but this will break compilation with ChibiOS 17.

Any comments on what would be the best solution?

Adrian

Duplicated launch configuration under TIVA demos

Hello,
Starting from ChibiOS 17.6.4 and ChibiOS 18.2.0 (current trunk) OpenOCD launch configuration will be placed under ($CHIBIOS)/tools/eclipse/debug/

This means that to see Launch configuration under the menu external tools of Eclipse the "ChibiOS Whole Tree" project shall be imported into workspace and be opened.

As each TIVA demo has a copy of the "OpenOCD on ICDI (prompts for .cfg target configuration)" under its debug folder, the external tools submenu is overfilled with replies of the same launch configuration.

I have committed a copy of this debug configuration under the tools folder so these extra file could now be removed.
Ciao,
RM

qeiUpdate, unexepcted value due to counter wrapping

In the QEI driver, the qeiUpdate function returns the counter delta from the last reading, which when the counter is wrapping result in a huge delta.

prev count current count delta expected delta
0 65535 65535 -1
65535 0 -65535 +1

USB host example/testhal broken on STM32F4

The testhal example (testhal/STM32/STM32F4xx/USB_HOST) for the USB host functionality does not seem to work on the STM32F4 DISCOVERY board (which is the hardware platform this example was originally written for).

What I'm seeing specifically is freezing of the program. One place this occurs in is _usbh_dbgf(). If I comment out those calls in the example, the processor successfully enters the main loop without issues, however as soon as I plug a USB device into the port the program freezes again. Unfortunately, digging deeper is a bit outside of my wheelhouse. I tried debugging through gdb over the ST-Link, but didn't really get anywhere.

Through the magic of git bisect I was able to determine that the testhal example has been broken since commit 958059c (introduced during the 20.3.x cycle). Prior to that everything seems to work as expected.

My guess is that the USBH LLD itself is broken and not the testhal example itself, but I can't verify this as I don't have any other code using the usb host functionality.

Background: My plan is to use the USB host functionality in QMK on the OTG2 of an STM32F446. After writing the initial QMK code I was not able to make it work, so I decided to go back trying out other people's code (the testhal example) in case I made a mistake.

Additional information:

Applying the suggestion in #267 did not fix the problem.

USB Host MSD returns invalid code

Hi all,

I think a bug was introduced in commit f014b8d. I'm not 100% sure, and would appreciate some input from the author @josesimoes. Originally, _scsi_perform_transaction returned MSD_RESULT_FAILED when transaction->csw_status was CSW_STATUS_FAILED, after performing a SCSI Request Sense. The commit introduced line 520, which would cause _scsi_perform_transaction to return MSD_RESULT_OK if the request sense was successful, even if the transaction was not carried out. I think the original code is correct. José, any comments?

static msd_result_t _scsi_perform_transaction(USBHMassStorageLUNDriver *lunp,
msd_transaction_t *transaction, void *data) {
msd_bot_result_t res;
res = _msd_bot_transaction(transaction, lunp, data);
if (res != MSD_BOTRESULT_OK) {
return (msd_result_t)res;
}
if (transaction->csw_status == CSW_STATUS_FAILED) {
if (transaction->cbw->CBWCB[0] != SCSI_CMD_REQUEST_SENSE) {
/* do auto-sense (except for SCSI_CMD_REQUEST_SENSE!) */
uwarn("\tMSD: Command failed, auto-sense");
USBH_DEFINE_BUFFER(scsi_sense_response_t sense);
if (scsi_requestsense(lunp, &sense) == MSD_RESULT_OK) {
uwarnf("\tMSD: REQUEST SENSE: Sense key=%x, ASC=%02x, ASCQ=%02x",
sense.byte[2] & 0xf, sense.byte[12], sense.byte[13]);
return MSD_RESULT_OK;
}
}
return MSD_RESULT_FAILED;
}
return MSD_RESULT_OK;
}

Thanks,
Diego.

ChibiOS RT needed

Hello,
I am using the HAL of ChibiOS but not the RT part because I do not need a RTOS for my projet.
I am using your QEI driver. It works nice but I had to move some:

#include "ch.h"

after the line checking if the module is used. Ex:

#if (HAL_USE_TIMCAP == TRUE) || defined(__DOXYGEN__)

The files I had to modify:

  • os/hal/include/hal_eeprom.h
  • os/hal/include/hal_timcap.h
  • os/hal/ports/STM32/LLD/DMA2Dv1/hal_stm32_dma2d.c
  • os/hal/ports/STM32/LLD/LTDCv1/hal_stm32_ltdc.c
  • os/hal/ports/STM32/LLD/TIMv1/hal_timcap_lld.c

So if the RT part is really needed for these components, maybe it will be possible to move the #include after the check is the module is used in order to allow users to use other modules without the RT part of ChibiOS.

Thanks.

STM32F7 FMC data bus ports alternate function issue

When I used mx2board.py to convert a .ioc file from an STM32F7 with an FMC memory controller peripheral, I found

  1. that the FMC was missing.
  2. Then I discovered that the STM32F769(G-I)T.xml file contains records for e.g.
    FMC_A4
    and
    FMC_D4
    for pin PE7

but the .ioc file calls the pin
FMC_D4_A4

I changed the code to match for FMC and modify the pin names in the Python code for the FMC
so that FMC_D0_A0 is mapped into FMC_D0

-- code snippet with changes
if prop_value.startswith('ADC') \
or 'DAC' in prop_value \
or 'OSC' in prop_value:
pads[pad_port][pad_num]["MODER"] = PIN_MODE_ANALOG
# Changes here to deal with the FMC
elif prop_value.startswith('FMC'):
pads[pad_port][pad_num]["OSPEEDR"] = PIN_OSPEED_HIGH
# There is an issue with the STM XML files: they list FMC_D0 and FMC_A0 but
# in fact the .ioc file contains FMC_D0_A0 as the prop_value
# so the idea here is to split the string then recombine the parts
# into a pattern the XML file contains
split_prop = prop_value.split("_")
pads[pad_port][pad_num]["SIGNAL"] = split_prop[0]+"_"+split_prop[1]
pads[pad_port][pad_num]["MODER"] = PIN_MODE_ALTERNATE
#end of changes to deal with FMC
elif 'GPIO_Output' == prop_value:
pads[pad_port][pad_num]["MODER"] = PIN_MODE_OUTPUT
elif 'GPIO_Input' == prop_value:
pads[pad_port][pad_num]["MODER"] = PIN_MODE_INPUT
-- end of snippet

[STM32] use DMA in USB host driver

For performance it would be good to use DMA in the USB host driver.

Currently the STM USB host library doesn't support hubs, and the ChibiOS-Contrib USB host driver doesn't use DMA, so it would be very valuable to have DMA in here, so one doesn't have to choose between performance and hub support.

Problem with Keychron K3V2 usb connection

I was having issues with SonixQMK on my Keychron K3V2, when i plug the keyboard to my machine it was sometimes not working completely and i had to replug it several times to get it to work.

While I was investigating this, I found that commit ff55126 has broken this keyboards usb behaviour. It is consistently working correctly on d5e4fb2 but it does not work on ff55126.

Please do investigate further.

USB Host Driver Status / Progress

Hi All,

First thing, I want to thank @dismirlian for his work on the USB Host driver thus far - it is really a great improvement over other options in this space for STM32, and I know it is no small task to write such a complex piece of code.

I have been experimenting with the latest revisions of the driver on here and it looks promising - I am hoping to use it as a replacement to the HCC USB Host stack in an ongoing project where we are encountering issues due to some design flaws in HCC's stack.

Couple things that I have encountered so far:

  • no support for out-of-tree drivers
    • need to modify the chibios-contrib code base itself to add any project specific drivers that may not be suitable for inclusion in chibios-contrib
  • PTXFE not implemented, meaning ISO/INT OUT transfers result in IRQ storm and lock up system
    • copying implementation from NPTXFE seems to work for at least INT OUT transfers so far - once I confirm ISO works I will be happy to submit a PR

Diego, have you given any thought to potential API's for better control over the enumeration process without modifying the chibios-contrib code base itself? I have hacked together some hooks to get up and running for now, but it is by no means pretty. I can try to clean up what I have so far and publish it for review if that helps.

I am idling on #chibios @ freenode if anyone wants to discus these topics.

Radio test NRF52 does not work?

Hi,

We have recently forked your repo to add support to the Decawave DWM1001 (it has one embedded nRF52832) for a student's project.

So far, all the tests work with ChibiOS. However, I have spent the last couple of days trying to make the radio test (https://github.com/ChibiOS/ChibiOS-Contrib/tree/chibios-20.3.x/testhal/NRF52/NRF52832/RADIO-ESB ) work.

I flashed the binary from that main (the only modifications are that LEDs and buttons are defined differently, you can find it here https://github.com/UCM-237/Distributed_localization_DWM1001/blob/radio_test/src/main.c ), and I can see the following:

With ack, the TX_FAILED event is triggered since there is no ack from the other radio.
With noack, the TX_SUCCESS event is triggered. However, the other radio never receives anything (the event or even the interruption is not triggered).

I wonder whether there is "this special" detail that I maybe overlook, such as timers incompatibilities or similar.
By the way, I have to set tx_payload.length = 32 , otherwise, if I use this line from the original code
https://github.com/UCM-237/Distributed_localization_DWM1001/blob/radio_test/src/main.c#L100 it does not work (I did not check with a debugger what is the result of this operation, but not TX event is triggered).

Thanks a lot in advance.

edit

I forgot to add that in this example, I am using the same mcuconf.cfg, hal.cfg, hal_community and ch.cfg as in the original test.

QEI on STM32

QEI define a callback type, but STM32 implementation doesn't make use of it.
Would it be possible to have a callback triggered when values change?

[STM32F37x] Using two comparators simultaneously bug

I've recently run into a bug while trying to use both of the analog comparators on STM32F37.
The problem seems to be that on STM32F37 and STM32F38 COMP1 and COMP2 share the same 32-bit register COMP_CSR, so configuring the second comparator affects the configuration of the first one.

Here's an example:

image
image
Breakpoint 1: COMP1 configured.

image
Breakpoint 3: Enabling COMP2 discards the COMP1 configuration.

I was able to fix this by adding some preprocessor directives to the os/hal/ports/STM32/LLD/COMPv1/hal_comp_lld.c, will create a pull request later.

ChibiOS version: stable_20.3.x
Compiler: arm-none-eabi-gcc (10.3-2021.10)
Platform and board: STM32F373CC (custom board)

usb host irq handler STM32_OTG_FS_HANDLER should be STM32_OTG1_HANDLER

OSAL_IRQ_HANDLER(STM32_OTG_FS_HANDLER) {

#if STM32_USBH_USE_OTG1
#ifdef STM32_OTG1_HANDLER
OSAL_IRQ_HANDLER(STM32_OTG1_HANDLER) {
#elif defined(STM32_OTG_FS_HANDLER)
OSAL_IRQ_HANDLER(STM32_OTG_FS_HANDLER) {
#else
#error "USBH_HANDLER undefined"
#endif
OSAL_IRQ_PROLOGUE();
osalSysLockFromISR();
usb_lld_serve_interrupt(&USBHD1);
osalSysUnlockFromISR();
OSAL_IRQ_EPILOGUE();
}
#endif

Platform.mk files should use their own SRC/INC variables

Now that ALLCSRC and ALLINC are defined, the platform.mk files should not append to PLATFORMSRC/INC. They should either create a new variable, or redefine PLATFORMSRC/INC, and then add the filenames to ALLCSRC, and ALLINC.

'const' qualifier needed for NANDConfig in community/os/hal/src/hal_nand.c

Hi IMHO,
Within the functions such as nandReadPageWhole(), nandp->config is defined as a constant pointer and would need the same to be handled correctly.

Code:
NANDConfig *cfg = nandp->config;

Should change to :
const NANDConfig *cfg = nandp->config;

in 7 functions in this file.

Thanks,
Abdulqadir Shabbir

Bug in hal_fsmc.h

First of all,
Thanks to @barthess, @fpoussin, and everyone else who contributed to providing NAND flash driver.
I recently tried moving from 18.2.0 to 20.3.2 and had following issues:

  1. For ChibiOS-Contrib/os/hal/include/hal_fsmc.h:37 => needs to include stm32f7x targets

  2. Also line324 on the same file has a typo "STM32_NAND_USE_NAND1" instead of "STM32_NAND_USE_NAND2"

  3. Should dmaStreamAlloc(nandp->dma, be=> nandp->dma = dmaStreamAlloc(STM32_NAND_DMA_STREAM,

If you guys deem it suitable, I can make these changes and do a pull request.

Thanks,
AQ

ChibiOS version: 20.3.2
Compiler: arm-none-eabi-gcc (7-2018-q2-update)(7.3.1)
Platform and board:STM32F723ZE (custom board)
Nature of the problem: Cannot compile
Failure mode: n/a

hal_ee24xx: potential infinite loop caused by __fitted_write when eeprom_write returns anything other than MSG_OK

in the case where eeprom_write fails repeatedly __fitted_write will never increment the value given to its written parameter.

status = eeprom_write(((I2CEepromFileStream *)ip)->cfg,
eepfs_getposition(ip), data, len);
if (status == MSG_OK) {
*written += len;
eepfs_lseek(ip, eepfs_getposition(ip) + len);
}

which in turn causes an infinite loop in write as shown below

while ((n - written) > pagesize) {
len = pagesize;
__fitted_write(ip, bp, len, &written);
bp += len;
}

eeprom_write simply passes on the return value from i2cMasterTransmitTimeout, which can return MSG_TIMEOUT if there is a timeout or MSG_RESET if an I2C bus error occurs.

The result is that if you have a mis-behaving eeprom, the software will deadlock.

In addition, if some transient error condition occurs, it would go unnoticed and result in very different data being written than expected - as well as read past end of buffer errors on bp since bp is incremented by len regardless of whether written gets incremented.

In short, the write method of the ee24xx driver is incredibly unreliable and has many bugs.
Quickly looking at the ee25xx driver (although I have not used it), the infinite loop issue was fixed, but the transient error issue still exists since the return value of __fitted_write is not checked every time it is called.

Warning compiling ChibiOS-Contrib chibios-17.6.x

Hello.

Im working on a project with Chibios 18.2.x (origin/stable_18.2.x) and Chibios-Contrib (origin/chibios-17.6.x). The Makefile of my project includes theses .mk files:

# ChibiOS files
include $(CHIBIOS)/os/license/license.mk
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk
include $(CHIBIOS)/os/hal/ports/STM32/LLD/EXTIv1/driver.mk
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk
# ChibiOS contrib files
include $(CHIBIOS_CONTRIB)/os/hal/hal.mk
include $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F0xx/platform.mk
# ChibiOS project
include $(CHIBIOS_CONTRIB_PRJ/os/hal/boards/ST_STM32F072B_PRJ/board.mk

I'm getting some warnings when compiling ChibiOS-Contrib/os/hal/src/hal_usb_hid.c file:

Compiling hal_usb_hid.c
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:137:3: warning: initialization makes integer from pointer without a cast
   write, read, put, get,
   ^
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:137:3: warning: (near initialization for 'vmt.instance_offset')
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:137:3: warning: initialization from incompatible pointer type
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:137:3: warning: (near initialization for 'vmt.write')
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:137:3: warning: initialization from incompatible pointer type
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:137:3: warning: (near initialization for 'vmt.read')
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:137:3: warning: initialization from incompatible pointer type
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:137:3: warning: (near initialization for 'vmt.put')
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:138:3: warning: initialization from incompatible pointer type
   putt, gett, writet, readt,
   ^
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:138:3: warning: (near initialization for 'vmt.get')
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:138:3: warning: initialization from incompatible pointer type
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:138:3: warning: (near initialization for 'vmt.putt')
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:138:3: warning: initialization from incompatible pointer type
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:138:3: warning: (near initialization for 'vmt.gett')
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:138:3: warning: initialization from incompatible pointer type
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:138:3: warning: (near initialization for 'vmt.writet')
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:140:1: warning: initialization from incompatible pointer type
 };
 ^
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:140:1: warning: (near initialization for 'vmt.readt')
./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:140:1: warning: missing initializer for field 'ctl' of 'const struct USBHIDDriverVMT' [-Wmissing-field-initializers]
In file included from ./ChibiOS/os/hal/include/hal.h:119:0,
                 from ./ChibiOS-Contrib/os/hal/src/hal_usb_hid.c:25:
./ChibiOS/os/hal/include/hal_channels.h:64:11: note: 'ctl' declared here
   msg_t (*ctl)(void *instance, unsigned int operation, void *arg);
           ^
./ChibiOS/os/hal/include/hal_channels.h:248:3: note: in expansion of macro '_base_channel_methods'
   _base_channel_methods                                                     \
   ^
./ChibiOS-Contrib/os/hal/include/hal_usb_hid.h:511:3: note: in expansion of macro '_base_asynchronous_channel_methods'
   _base_asynchronous_channel_methods                                        \
   ^
./ChibiOS-Contrib/os/hal/include/hal_usb_hid.h:521:3: note: in expansion of macro '_usb_hid_driver_methods'
   _usb_hid_driver_methods
   ^

Are these warnings normal? Can be fixed in some way?

Thanks in advance!

QEI driver warnings

Please fix:
ChibiOS version - 17.6.3
community/os/hal/include/hal_qei.h

 */
 typedef enum {
   QEI_OVERFLOW_WRAP    = 0,     /**< Counter value will wrap around.        */
-#if QEI_USE_OVERFLOW_DISCARD == TRUE
+#if defined(QEI_USE_OVERFLOW_DISCARD) && QEI_USE_OVERFLOW_DISCARD == TRUE
   QEI_OVERFLOW_DISCARD = 1,     /**< Counter doesn't change.                */
 #endif
-#if QEI_USE_OVERFLOW_MINMAX == TRUE
+#if defined(QEI_USE_OVERFLOW_MINMAX) && QEI_USE_OVERFLOW_MINMAX == TRUE
   QEI_OVERFLOW_MINMAX  = 2,     /**< Counter will be updated upto min or max.*/
 #endif
 } qeioverflow_t;

[onewire] Strange uint_fast8_t issue

I'm using the onewire driver on an STM32F042F6P6 with ARM-GCC 4.9.3. I was having issues with onewireReset always returning false.

The initial check that the bus was high was always failing, even though it was definitely high (verified with multimeter) and there was no bus activity. If I tried to check the state myself with palReadPad, it would always return 1.

It appears that is somehow related to the uint_fast8_t return type on ow_read_bit. Replacing this line:

if (PAL_LOW == ow_read_bit(owp))

With this:

if ((uint_fast8_t)PAL_LOW == ow_read_bit(owp))

Seems to fix the issue (although it still happens in numerous other places in the code). I have no idea why.

FMC SDRAM driver compatibility for STM32F7

Hello,

I am using the HAL FSMC driver for SDRAM on STM32F746 without any issues. I assume that STM32F4 and STM32F7 share the same FMC hardware. For making it compile, I had to add some switches to the source files.

Normally, there is this statement here to allow compilation only for certain processors:

#if (defined(STM32F427xx) || defined(STM32F437xx) || \
     defined(STM32F429xx) || defined(STM32F439xx))

Please change that to something like this or similar:

#if (defined(STM32F427xx) || defined(STM32F437xx) || \
     defined(STM32F429xx) || defined(STM32F439xx) || \
     defined(STM32F746xx))

for use with STM32F7 family processors. I am not sure which processors of the F7 family can be used, as I can test only the STM32F746.

This affects the following files:
/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.h
/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc.c
/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.h
/os/hal/ports/STM32/LLD/FSMCv1/hal_fsmc_sdram.c

Thank you,
Adrian

USB HID demo or testhal project

Hello,

Do you plan to add some testhal project for USB HID communication (i.e. for stm32)? Maybe a simple python program for PC side would be also very useful.

Question: How should peripheral symbols numbered?

Related to #235.
I would like these numbered in straight forward way. What does the design guide say?
@fpoussin @alexclewontin

NUC123_I2C1_GLOBAL_HANDLER → NUC123_I2C0_HANDLER ?
NUC123_I2C1_GLOBAL_NUMBER → NUC123_I2C0_NUMBER ?

NUC123_I2C2_GLOBAL_HANDLER → NUC123_I2C1_HANDLER ?
NUC123_I2C2_GLOBAL_NUMBER → NUC123_I2C1_NUMBER ?

NUC123_HAS_I2C0
NUC123_HAS_I2C1

NUC123_I2C_USE_I2C0
NUC123_I2C_USE_I2C1

I2CD1 → I2CD0 ?
I2CD2 → I2CD1 ?

edit: and why _GLOBAL_ ?

mx2board.py issue with STM32F7XX .ioc file

Thanks for the tool, I picked it up as a part of the ChibiOS distribution then found the original on GitHub.

In the case of using STM32F7XX.ioc file

Opening stm32f7_2.ioc
MCU is STM32F765N(G-I)Hx
Opened C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\db\mcu\
Opening GPIO file C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeMX\db\mcu\\IP\GPIO-STM32F76x_gpio_v1_0_Modes.xml
Opening project file stm32f7_2.ioc
Traceback (most recent call last):
  File "mx2board2.py", line 332, in <module>
    defines = gen_defines(proj)
  File "mx2board2.py", line 273, in gen_defines
    ch_num = int(signal[-1:])
ValueError: invalid literal for int() with base 10: 'R'

The error is caused by the fact that the .ioc file contains lines like

SH.S_TIM2_CH1_ETR.0=TIM2_CH1,Input_Capture1_from_TI1

The regular expression at line 271 matches the pattern terminating ETR rather than a digit.
`
defines['PORT
'+label] = 'GPIO' + port_key
defines['PAD_'+label] = pad_key

        if re.search(r"TIM\d_CH\d$", signal, re.M):  <---- 
            timer = signal.replace('S_TIM', '').replace('_CH', '')[:-1]
            ch_num = int(signal[-1:])

`
There needs to be a '$' to only match complete strings at the end of the regular expression, this avoids matching names like TIM2_CH1_ETR.
I am not sure whatever other sideffects there are of this change, it produced a valid-appearing board.h after changing this.

[Enhancement] USBH driver with external USB host controller

I am planning to implement a driver of MAX3421E for ChibiOS. After doing some research, I think the best way to do it is to implement a complex driver that sits on top of the SPI driver. I would try to avoid writing a LLD driver for it since the LLD looks more like a place for "MCU-specific" code and the MAX3421E does not depend on the MCU. However, I also found that the USBH driver calls usbh_lld_* function of specific LLD implementation of a certain MCU, which means the external controller and the MCU built-in controller cannot possibly co-exist if I implement the usbh_lld_* in my driver (and also the code may look weird since usbh_lld_* appears in a complex driver).

So my question: Whatt is the best way to implement such driver that cooperates with USBH, or is it just a bad idea for the current USBH implementation?

Lack elements in struct GPTConfig in the source of HT32's hal_gpt_lld.h

When I build my qmk project,I encountered the problem as follows.

Compiling: platforms/chibios/wait.c
platforms/chibios/wait.c: In function 'wait_us':
platforms/chibios/wait.c:24:54: error: excess elements in struct initializer [-Werror]
24 | static const GPTConfig gpt_cfg = {1000000, NULL, 0, 0}; /* 1MHz timer, no callback /
| ^
platforms/chibios/wait.c:24:54: note: (near initialization for 'gpt_cfg')
platforms/chibios/wait.c:24:57: error: excess elements in struct initializer [-Werror]
24 | static const GPTConfig gpt_cfg = {1000000, NULL, 0, 0}; /
1MHz timer, no callback */
| ^
platforms/chibios/wait.c:24:57: note: (near initialization for 'gpt_cfg')
cc1: all warnings being treated as errors
[ERRORS]

Comparing the source hal_gpt_lld.h of HT32 with the one of STM32,the two elements cr2 and dier should be added to the struct GPTConfig.

The source hal_gpt_lld.h of HT32 is in the folder -- "chibios-contrib\os\hal\ports\HT32\LLD\TIMv1".

Problem using USB Host for MSD wit OTG2

Hey,

I'm trying to migrate some code for USB Host on MSD connected to OTG2. This with a STM32F7.
This was working just fine in version 19.1.x (if I'm not mistaken).

I can see that a lot of code changes were made in recent versions. Also that the test code that exists is using OTG1.
Any pointers you can give me or "obvious places" to look at, so I can try to pin point the root cause?

Thanks!

SDRAM start leads to panic (SV4)

The current version of SDRAM drivers breaks execution when calling sdramStart() because of nested calls to osalSysLock(). After sdram_lld_start() -> sdram_lld_init_sequence(), the thread is put to sleep with osalThreadSleepMilliseconds(), which also contains a osalSysLock() statement, leading to the SV4 panic.

I suggest to remove the lock statements from sdramStart() to restore functionality. Are they actually required? If not, I can create a pull request.

Build error RT-WVSHARE_BLE400

Compiling with ChibiOS master and ChibiOS-Contrib master

/home/sdalu/ChibiOS/ChibiOS/os/common/startup/ARMCMx/compilers/GCC/rules.mk:216: target 'build/obj/chcoreasm_v6m.S' doesn't match the target pattern
Compiling
arm-none-eabi-gcc: warning: '-x assembler-with-cpp' after last input file has no effect
arm-none-eabi-gcc: fatal error: no input files
compilation terminated.
/home/sdalu/ChibiOS/ChibiOS/os/common/startup/ARMCMx/compilers/GCC/rules.mk:221: recipe for target 'build/obj/chcoreasm_v6m.S' failed

not NUC123SD4AN0 but NUC123

It should be os/hal/ports/NUMICRO/NUC123/platform.mk
instead of os/hal/ports/NUMICRO/NUC123SD4AN0/platform.mk .
and so on.

[NUC123] Reported USB intermittent enumeration failure

@fishman I don't have any code to open a PR for your reported intermittent detection failure yet, so we can use this issue for discussion.

I still cannot reproduce it. When you experience this failure, how much traffic is being routed through the hub? Is the keyboard the only device, or are there others? When the keyboard failure occurs, do other devices passing through the hub continue to function normally?

Update: my USB hub appears to be on the fritz. I don't think I can reproduce (I've never had the USB hub detected but not the keyboard. I've tested the USB hub with some other devices, and I think the issue is an intermittent connection in the cable. It was cheap and you get what you pay for ¯\_(ツ)_/¯), but I have a new hub on the way, which should be helpful in diagnosis.

ChibiOS 19.1.x and 20.3.x branches

Add branches for ChibiOS 19.1.x and 20.3.x

The current master seems to work with 19.1.x, and the commit messages indicate that too, but it would be much clearer to with the proper branch name.

For 20.3.x some changes to the makefiles and config files must be made. Apart from that at least the USB_MSD driver seems to work.

COMPv1 and stm32L031

Hi, i need a help of ChibiOS's Contrib community.

I am newbie in ChibiOS architectory. So faced with promblem when adopting COMPv1 to stm32L031 (M0).

In stm32l031 (Mo) Comparator uses interrupt - ADC1_COMP_IRQHandler same that a ADC.

But in COMPv1 - STM32_COMP_1_2_3_IRQ_PRIORITY (COMP_1) and and STM32_COMP_1_2_3_IRQ_PRIORITY (COMP_2).

As i understand ChibiOS HAL use ADC1_COMP_IRQHandler for ADC HAL Driver? Or i can change library to use ADC1_COMP_IRQHandler?

add support for STM32F413xx

I see that you've recently updated the STM32 libraries to include the new STm32F413xx, but there isn't a ChibiOS port yet to utilize it.

Tools running on the host system

Hello,

I'm porting ChibiOS to the Teensy 3.5 board and while it's nowhere near production quality, I'm at a point that the GPIOs and all the 4 UARTs work correctly. Also all the standard tests run successfully.

However I'm stuck with a problem relevant to the PLL configuration: every information I need to generate the PLL divisor and multiplier is known at compile time, yet I'm still computing their value at runtime on the MCU, similar to the way it's done in the K20x ports.

I could simplify everything by running a custom program on the host system that includes the needed headers and generates a header with the PLL divisor and multiplier. The latter would then be included directly by hal_lld.c which would correctly set the PLL. In the case no suitable combination of divisor and multiplier is found the tool would return an error and end the compilation.

My problem is I don't know the ChibiOS makefiles very well, so I added custom targets in my board.mk. Unfortunately I had to hardcode the gcc compiler, options, include paths and everything. I had to provide a fake first: all target to keep the existing make behaviour.

Is there a better way to do it? Should I stick to the way explained above?
Or should I compute the values for the PLL at runtime?

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.