Skip to content
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

STM32: Refactor us_ticker.c + hal_tick.c files #3213

Merged
merged 20 commits into from
Nov 29, 2016

Conversation

bcostm
Copy link
Contributor

@bcostm bcostm commented Nov 7, 2016

Description

The goal of this PR is to refactor the us_ticker.c and hal_tick.c files.

Now only 4 files are used for all the STM32 devices and placed in TARGET_STM folder:

  • us_ticker_16b.c + hal_tick_16b.c for devices using a 16bit timer
  • us_ticker_32b.c + hal_tick_32b.c for devices using a 32bit timer

Two definitions have also been added in the hal_tick.h file to indicate the timer type and the peripheral clock number:
#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer
#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2)

Status

READY

Migrations

NO

@bridadan
Copy link
Contributor

bridadan commented Nov 7, 2016

Man, gotta love that diff! 😄 Thanks for the changes @bcostm!

/morph test

@bridadan
Copy link
Contributor

bridadan commented Nov 7, 2016

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=ALL
TARGETS=ALL

@mbed-bot
Copy link

mbed-bot commented Nov 7, 2016

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1012

Test failed!

@mbed-bot
Copy link

mbed-bot commented Nov 7, 2016

[Build 1092]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@bridadan
Copy link
Contributor

bridadan commented Nov 7, 2016

There was a timing failure on an unrelated board. We were experiencing an issue with one of our CI machines this morning, so this is most likely an infrastructure issue. I'll rerun it now.

/morph test

@mbed-bot
Copy link

mbed-bot commented Nov 8, 2016

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1020

All builds and test passed!

@bridadan
Copy link
Contributor

bridadan commented Nov 8, 2016

@0xc0170 Could you review please?

static int us_ticker_inited = 0;

void us_ticker_init(void)
{
void us_ticker_init(void) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why did you change the style ? I understand there might be some inconsistency that should be fixed . It was good as it was.

Copy link
Contributor Author

@bcostm bcostm Nov 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

humm... I thought it was the correct style this is why I changed it. But ok I will modify it.

@@ -1,5 +1,5 @@
/* mbed Microcontroller Library
* Copyright (c) 2015, STMicroelectronics
* Copyright (c) 2014, STMicroelectronics
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2016?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I will update it

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 8, 2016

Impressive diff for this one. +1 @bcostm . I just left there style comments.

@bcostm
Copy link
Contributor Author

bcostm commented Nov 14, 2016

Rebased + typo corrections. As you can note, I have also updated the license + date. I took the same license as written in mbed.h file.

@sg- sg- added needs: CI and removed needs: work labels Nov 14, 2016
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 16, 2016

Future reference: Please write more descriptive commit messages, this commit msg could be improved Minor changes

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 16, 2016

/morph test

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 16, 2016

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=ALL
TARGETS=ALL

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 18, 2016

Our CI needs restarting, once CI done, all good, this should be ready for integration.

cc @bridadan

@bridadan
Copy link
Contributor

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=ALL
TARGETS=ALL

@bridadan
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1125

All builds and test passed!

@mbed-bot
Copy link

[Build 1125]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@0xc0170 0xc0170 removed the needs: CI label Nov 21, 2016
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 21, 2016

@bcostm I see some regression for this PR. I compared this to the latest nightly (master), all is regarding timers, so might be legit

Nucleo L053R8 - IAR - Timeout Int us FAIL
Nucleo F411RE - uARM - Ticker Int and Timeout Int us

// Timeout Int us
BED: Instrumentation: "COM24" and disk: "R:"
HOST: Copy image onto target...
        1 file(s) copied.
Looking for NUCLEO_F411RE with MBEDLS
Remount complete
HOST: Initialize serial port...
Looking for NUCLEO_F411RE with MBEDLS
...port ready!
HOST: Reset target...
HOST: Property 'timeout' = '15'
HOST: Property 'host_test_name' = 'wait_us_auto'
HOST: Property 'description' = 'Timeout Int us'
HOST: Property 'test_id' = 'MBED_24'
HOST: Start test...
* in 1.01 sec (0.01) [OK]
* in 1.01 sec (0.01) [OK]
* in 1.01 sec (0.01) [OK]
* in 1.01 sec (0.01) [OK]
* in 1.01 sec (0.01) [OK]
* in 1.01 sec (0.01) [OK]
* in 0.30 sec (0.70) [FAIL]
* in 1.72 sec (0.72) [FAIL]
* in 1.01 sec (0.01) [OK]
* in 0.22 sec (0.78) [FAIL]
* in 1.80 sec (0.80) [FAIL]
* in 1.01 sec (0.01) [OK]
* in 1.01 sec (0.01) [OK]
Consecutive OK timer reads: 2
Completed in 13.10 sec

{{failure}}
{{end}}
// Ticker Int
	
MBED: Instrumentation: "COM24" and disk: "R:"
HOST: Copy image onto target...
        1 file(s) copied.
Looking for NUCLEO_F411RE with MBEDLS
Remount complete
HOST: Initialize serial port...
Looking for NUCLEO_F411RE with MBEDLS
...port ready!
HOST: Reset target...
HOST: Property 'timeout' = '15'
HOST: Property 'host_test_name' = 'wait_us_auto'
HOST: Property 'description' = 'Ticker Int'
HOST: Property 'test_id' = 'MBED_11'
HOST: Start test...
* in 1.00 sec (0.00) [OK]
* in 1.00 sec (0.00) [OK]
* in 1.00 sec (0.00) [OK]
* in 0.51 sec (0.49) [FAIL]
* in 1.48 sec (0.48) [FAIL]
* in 1.00 sec (0.00) [OK]
* in 1.00 sec (0.00) [OK]
* in 1.00 sec (0.00) [OK]
* in 0.65 sec (0.35) [FAIL]
* in 1.34 sec (0.34) [FAIL]
* in 1.00 sec (0.00) [OK]
* in 0.85 sec (0.15) [FAIL]
* in 1.15 sec (0.15) [FAIL]
Consecutive OK timer reads: 0
Completed in 13.00 sec

{{failure}}

Nucleo F334R8 - uARM - TIme us

//Time us
MBED: Instrumentation: "COM68" and disk: "I:"
HOST: Copy image onto target...
        1 file(s) copied.
Looking for NUCLEO_F334R8 with MBEDLS
Remount complete
HOST: Initialize serial port...
Looking for NUCLEO_F334R8 with MBEDLS
...port ready!
HOST: Reset target...
HOST: Property 'timeout' = '15'
HOST: Property 'host_test_name' = 'wait_us_auto'
HOST: Property 'description' = 'Time us'
HOST: Property 'test_id' = 'MBED_25'
HOST: Start test...
* in 1.00 sec (0.00) [OK]
* in 1.00 sec (0.00) [OK]
* in 1.00 sec (0.00) [OK]
* in 1.00 sec (0.00) [OK]
* in 1.00 sec (0.00) [OK]
* in 1.00 sec (0.00) [OK]
* in 0.40 sec (0.60) [FAIL]
* in 1.60 sec (0.60) [FAIL]
* in 1.00 sec (0.00) [OK]
* in 0.35 sec (0.65) [FAIL]
* in 1.65 sec (0.65) [FAIL]
* in 1.00 sec (0.00) [OK]
* in 1.00 sec (0.00) [OK]
Consecutive OK timer reads: 2
Completed in 13.01 sec

{{failure}}

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 21, 2016

Running it one more time to be certain:

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=ALL
TARGETS=ALL

@mbed-bot
Copy link

[Build 1132]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@bcostm
Copy link
Contributor Author

bcostm commented Nov 23, 2016

What is the result of the last tests ? Do I need to do something ?

@bridadan
Copy link
Contributor

Looks there was failure on the NUCLEO_L053R8. I'm gonna run it one more time just to be sure.

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=ALL
TARGETS=NUCLEO_L053R8

@mbed-bot
Copy link

[Build 1142]
SUCCESS: Building succeeded and tests were run! Be sure to check the test results

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 29, 2016

Tests look OK, not connected to this patch (that failure is random). As stated above, @bcostm are you aware of this, can you reproduce locally ?

This shall be good to go

@0xc0170 0xc0170 merged commit bb2d03f into ARMmbed:master Nov 29, 2016
@bcostm bcostm deleted the factorize_ticker branch November 30, 2016 14:11
aisair pushed a commit to aisair/mbed that referenced this pull request Apr 30, 2024
Ports for Upcoming Targets

3241: Add support for FRDM-KW41 ARMmbed/mbed-os#3241
3291: Adding mbed enabled Maker board with NINA-B1 and EVA-M8Q ARMmbed/mbed-os#3291

Fixes and Changes

3062: TARGET_STM :USB device FS  ARMmbed/mbed-os#3062
3213: STM32: Refactor us_ticker.c + hal_tick.c files ARMmbed/mbed-os#3213
3288: Dev spi asynch l0l1 ARMmbed/mbed-os#3288
3289: Bug fix of initial value of interrupt edge in "gpio_irq_init" function. ARMmbed/mbed-os#3289
3302: STM32F4 AnalogIn - Clear VBATE and TSVREFE bits before configuring ADC channels ARMmbed/mbed-os#3302
3320: STM32 - Add ADC_VREF label ARMmbed/mbed-os#3320
3321: no HSE available by default for NUCLEO_L432KC ARMmbed/mbed-os#3321
3352: ublox eva nina - fix line endings ARMmbed/mbed-os#3352
3322: DISCO_L053C8 doesn't support LSE ARMmbed/mbed-os#3322
3345: STM32 - Remove TIM_IT_UPDATE flag in HAL_Suspend/ResumeTick functions ARMmbed/mbed-os#3345
3309: [NUC472/M453] Fix CI failed tests ARMmbed/mbed-os#3309
3157: [Silicon Labs] Adding support for EFR32MG1 wireless SoC ARMmbed/mbed-os#3157
3301: I2C - correct return values for write functions (docs) - part 1 ARMmbed/mbed-os#3301
3303: Fix #2956 #2939 #2957 #2959 #2960: Add HAL_DeInit function in gpio_irq destructor ARMmbed/mbed-os#3303
3304: STM32L476: no HSE is present in NUCLEO and DISCO boards ARMmbed/mbed-os#3304
3318: Register map changes for RevG ARMmbed/mbed-os#3318
3317: NUCLEO_F429ZI has integrated LSE ARMmbed/mbed-os#3317
3312: K64F: SPI Asynch API implementation ARMmbed/mbed-os#3312
3324: Dev i2c common code ARMmbed/mbed-os#3324
3369: Add CAN2 missing pins for connector CN12 ARMmbed/mbed-os#3369
3377: STM32 NUCLEO-L152RE Update system core clock to 32MHz ARMmbed/mbed-os#3377
3378: K66F: Enable LWIP feature ARMmbed/mbed-os#3378
3382: [MAX32620] Fixing serial readable function. ARMmbed/mbed-os#3382
3399: NUCLEO_F103RB - Add SERIAL_FC feature ARMmbed/mbed-os#3399
3409: STM32L1 : map ST HAL assert into MBED assert ARMmbed/mbed-os#3409
3416: Renames i2c_api.c for STM32F1 targets to fix IAR exporter ARMmbed/mbed-os#3416
3348: Fix frequency function of CAN driver. ARMmbed/mbed-os#3348
3366: NUCLEO_F412ZG - Add new platform ARMmbed/mbed-os#3366
3379: STM32F0 : map ST HAL assert into MBED assert ARMmbed/mbed-os#3379
3393: ISR register never re-evaluated in HAL_DMA_PollForTransfer for STM32F4 ARMmbed/mbed-os#3393
3408: STM32F7 : map ST HAL assert into MBED assert ARMmbed/mbed-os#3408
3411: STM32L0 : map ST HAL assert into MBED assert ARMmbed/mbed-os#3411
3424: STM32F4 - FIX to add the update of hdma->State variable ARMmbed/mbed-os#3424
3427: Fix stm i2c slave ARMmbed/mbed-os#3427
3429: Fix stm i2c fix init ARMmbed/mbed-os#3429
3434: [NUC472/M453] Fix stuck in lp_ticker_init and other updates ARMmbed/mbed-os#3434
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants