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

Some fixes for Teensy4 #272

Merged
merged 5 commits into from
Apr 27, 2024
Merged

Some fixes for Teensy4 #272

merged 5 commits into from
Apr 27, 2024

Conversation

multiplemonomials
Copy link
Collaborator

@multiplemonomials multiplemonomials commented Apr 23, 2024

Summary of changes

This PR fixes a couple issues that my friend Kate Hendrix discovered when using the Teensy4 with Mbed for a project. The issues are:

  • Missing pinmappings for SPI and UART pins. NXP decided to be lazy and only added pinmappings for the ~10 pins that are exposed on the EVK board, ignoring all the others. However, many more of these pins are available on Teensy4, so now all the SPI and UART ones have mappings. Note that there are still a lot more pin mappings to add, such as PWM and SPI HW CS, but this is a start at least.
  • Using SPI in transaction mode causes glitched, microscopic SCLK pulses between each byte/word of the transfer instead of normal length SCLK pulses. It turns out that this is due to the IMX spi_api.c not correctly populating a specific SPI timing register (which is also ignored by the FSL HAL library). This PR tries to fix this issue by setting the register.
  • Failure to compile due to typo'd header name (Error trying to build for Teeny 4 boards #207)
  • Calling SPI::format() after SPI::frequency() would reset back to the default frequency of 500kHz
  • DEVICE_SPI_COUNT not implemented for MIMXRT (Every Mbed target should be required to implement spi_get_peripheral_name() #255

Impact of changes

Migration actions required

Documentation

None


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR

We tested this SPI fix on hardware and it makes the issue go away! We are also now able to use UART on Teensy4 (via its "UART2" connection) which previously was not usable.


Reviewers


@multiplemonomials multiplemonomials changed the title [draft] Some fixes for Teensy4 Some fixes for Teensy4 Apr 26, 2024
@multiplemonomials multiplemonomials merged commit e8b6238 into master Apr 27, 2024
9 checks passed
@multiplemonomials multiplemonomials deleted the dev/fix-teensy4-build branch April 27, 2024 17:10
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