Skip to content

Add support for TRGO events in STM32_Timer.#197

Open
jaguilar wants to merge 1 commit intorenode:masterfrom
jaguilar:master
Open

Add support for TRGO events in STM32_Timer.#197
jaguilar wants to merge 1 commit intorenode:masterfrom
jaguilar:master

Conversation

@jaguilar
Copy link
Copy Markdown

This both adds support for TRGO and also adds support for certain slave timer types. Also adds a unit test for the STM32_Timer peripheral.

I have a separate pull request that I can file after this to the renode repo that adds a robot test for these features. I also have a test firmware to contribute that exercises the timers from the device side. (See main.c and test.robot.)

In case it matters, AI assistance was used in the composing of this set of changes. If that's an issue, I can just continue to use my personal fork, but I thought this code would be of use to other people potentially. Please let me know if there is a suite of tests I should run to ensure I haven't broken any other part of the system.

Change 1/N to address renode/renode#898.

This both adds support for TRGO and also adds support for certain slave
timer types. Also adds a unit test for the STM32_Timer peripheral.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 10, 2026

CLA assistant check
All committers have signed the CLA.

@PiotrZierhoffer
Copy link
Copy Markdown
Member

Hi @jaguilar ,

Thanks for the contribution.

Would you consider the unit test you posted more or less equivalent to the test software you linked, or are they testing different things?

@jaguilar
Copy link
Copy Markdown
Author

The unit test covers some similar bases but it faces the same problem as all unit tests vs. integration tests.

E.g. we test that there is a TRGO GPIO, and we test that it does the things it is supposed to do when you set certain conditions on the registers. Likewise we show that if you subscribe to a given GPIO in the trigger matrix and it fires, the right things happen. What it doesn't really show is that the interpretation of the registers is the same as how a real STM32 program interprets those registers, or that when you put it all together you get the expected set of follower-timer behaviors.

I'm agnostic as to whether we include both tests -- it's really down to y'all's testing standards. AFAICT there was not very much testing of the details of stm32 timers before this -- at least not that I could find in the repos. So an argument could be made that just adding the unit test improves the state of affairs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants