-
Notifications
You must be signed in to change notification settings - Fork 3k
STM32: spi_frequency table index fix #3759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In case of prescaler_rank was 0, a -1 index was being used, which resulted in initialization of the Init.BaudRatePrescaler with random values. Now let's better check index and avoid -1 operation, so that prescaler_rank can be only from 0 to "last_index".
/morph test |
I tested the new spi_frequency() function, it is now much cleaner, I tested it with my 40 Mhz example as well with the 100 kHz example. It works now as expected. |
retest uvisor |
/morph test |
Result: FAILUREYour command has finished executing! Here's what you wrote!
OutputTest failed! |
/morph test |
Result: SUCCESSYour command has finished executing! Here's what you wrote!
OutputAll builds and test passed! |
With this patch 100KHz no longer works on the Odin (NUCLEO_F439ZI) and NUCLEO_F429ZI. When the SDBlockDevice is used I get:
|
@c1728p9 : I think this was already the case before. So you're requesting 100kHz which is a pretty low SPI frequency, and the lowest available frequency based on current clock configuration of F429ZI is 328125kHz (84MHz with 256 prescaler). But maybe the error call in this case is a mistake, I think we could live with a warning (as this proved to work most of the time so far) ? May you try out with a warn() call instead of error() ? Also have you raised an issue for it ? thanks |
Ports for Upcoming Targets Fixes and Changes 3590: [NUC472/M453] Export IAR project and other bugfixes ARMmbed/mbed-os#3590 3740: STM32L4 HAL update for RTC Wake Up Timer ARMmbed/mbed-os#3740 3739: STM32F7 : remove multiple HSE_VALUE define value ARMmbed/mbed-os#3739 3759: STM32: spi_frequency table index fix ARMmbed/mbed-os#3759 3779: NCS36510: Fix the sporadic semaphore timing issue ARMmbed/mbed-os#3779 3806: NXP KL43Z/KL27Z: fix spi format bits check ARMmbed/mbed-os#3806 3814: NCS36510: I2C idle delay of 1us ARMmbed/mbed-os#3814 3803: Bug fix of initial value of interrupt edge in "gpio_irq_init" again ARMmbed/mbed-os#3803
Description
This fix address issue #3735
In case of prescaler_rank was 0, a -1 index was being used,
which resulted in initialization of the Init.BaudRatePrescaler with
random values.
Now let's better check index and avoid -1 operation, so that prescaler_rank
can be only from 0 to "last_index".
Status
READY
Tested with various range of clock on L4 device, including max frequency as reported in the Issue