Mbed-os: FPGA CI shield assumes UART behaviour it shouldn't

Created on 9 Jul 2019  路  6Comments  路  Source: ARMmbed/mbed-os

Description

The FPGA CI shield UART test currently assumes that the Serial HAL's TX IRQ gets fired whenever a new byte can be sent, whereas our implementation fires the TX IRQ whenever a byte actually got sent.
There doesn't seem to be a definition in the mbed documentation anywhere to specify which of the two is correct, but a test shouldn't just assume one when such an ambiguity exists.

CC @c1728p9

Issue request type


[ ] Question
[ ] Enhancement
[X] Bug

IOTOSM-462 DONE mirrored bug

All 6 comments

@fkjagodzinski can you look into fixing this?

Internal Jira reference: https://jira.arm.com/browse/IOTOSM-462

Things like UARTSerial assume that a TX IRQ works as is traditional for UART's - it's the "TX data port empty" interrupt indicating that we can now give data to the UART.

There are places it would be nice to have a "TX idle" interrupt indicating that it's finished (so it's now safe to sleep/power off), but that API has not been standardised.

If the documentation isn't clear, that may need work, but as far as I'm aware, the Mbed OS code base relies on the "TX empty" semantics, so that's what needs to be tested.

Looking at it, it seems like UARTSerial also relies on immediate interrupt generation if the interrupt is enabled while the "TX empty" or "RX non-empty" condition holds at the instant "attach" is called. (Not in the common path, but I see a potential race if that isn't the case).

If we have the ability to test that, it would be good to document and standardise that immediate-IRQ behaviour - I can imagine there's quite a lot of manually written third-party interrupt handlers that might be flakey if the HAL doesn't behave like that.

  • If the documentation isn't clear, that may need work, but as far as I'm aware, the Mbed OS code base relies on the "TX empty" semantics, so that's what needs to be tested.

  • it would be good to document and standardise that immediate-IRQ behaviour

These will be fixed with #11032 which adds a defined/undefined behavior section to Serial HAL doxy.

I think we can close this. The doc fix has been merged quite a while ago. ;) https://github.com/ARMmbed/mbed-os/pull/11032/files#diff-4b9311f76dd0e4092ded0f755b879462a78fdff4bbc22e0447cb158a21b3b0e3R127-R130

Was this page helpful?
0 / 5 - 0 ratings

Related issues

drahnr picture drahnr  路  4Comments

davidantaki picture davidantaki  路  3Comments

bulislaw picture bulislaw  路  3Comments

MarceloSalazar picture MarceloSalazar  路  3Comments

cesarvandevelde picture cesarvandevelde  路  4Comments