Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Add support for Common I/O (UART, SPI and I2C) on ESP32 #1946

Merged
merged 1 commit into from
Sep 14, 2020

Conversation

shubhamkulkarni97
Copy link
Contributor

Description

This PR intends to add support for UART, SPI and I2C modules in Common I/O

Checklist:

  • I have tested my changes. No regression in existing tests.
  • My code is Linted.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@tgsong tgsong requested a review from qiutongs April 29, 2020 23:44
@qiutongs
Copy link
Contributor

qiutongs commented May 8, 2020

As discussed, ESP is updating the implementation for async function. Using FreeRTOS timer is not the preferable option.

@qiutongs qiutongs added the Draft label Jun 5, 2020
@abhidixi11 abhidixi11 requested review from cobusve and removed request for qiutongs July 13, 2020 20:50
@abhidixi11 abhidixi11 assigned cobusve and unassigned qiutongs Jul 13, 2020
@lundinc2
Copy link
Contributor

/bot run checks

YTvW
YTvW previously approved these changes Aug 11, 2020
@teuteuguy
Copy link

Any updates on this PR ?

@lundinc2
Copy link
Contributor

lundinc2 commented Sep 3, 2020

@shubhamkulkarni97 @teuteuguy,

As discussed originally, we were going to wait for Async, without the reliance of FreeRTOS timer. We will reverse that decision and take this as is with the hope of adding that later.

@shubhamkulkarni97 I believe to get this merged, all we need to do is rebase this branch, and resolve two variables causing the build failures.

The issue is caused by uctestIotI2CSlaveAddr and ucAssistedTestIotI2CSlaveAddr. Alongside this, I will remove the calls to portYIELD_FROM_ISR that are generating build errors when building for the esp32.

Please let me know if you are still willing to do this, otherwise I can create a mirror'd PR with those changes.

Thanks,

Carl

@shubhamkulkarni97
Copy link
Contributor Author

@teuteuguy @lundinc2, will rebase PR to latest master and make it available for review soon.

@shubhamkulkarni97
Copy link
Contributor Author

Hi @lundinc2 @teuteuguy,

I have updated the PR with latest changes. With this change, common-io drivers don't have any dependency on FreeRTOS timer for async implementation.

There is one failure in UART test case(AFQP_IotUARTWriteAsyncReadAsyncLoopbackTest).
I believe it is a bug in test case as there is no delay between start of transaction and request for eGetTxNoOfbytes.

Moving vTaskDelay above request for eGetTxNoOfbytes fixes the failure.

Please help verify this issue.

Thanks,
Shubham

@lundinc2
Copy link
Contributor

lundinc2 commented Sep 4, 2020

Hi @shubhamkulkarni97, I agree this is a bug. I will update this.

@lundinc2
Copy link
Contributor

lundinc2 commented Sep 4, 2020

/bot run checks

2 similar comments
@lundinc2
Copy link
Contributor

lundinc2 commented Sep 8, 2020

/bot run checks

@lundinc2
Copy link
Contributor

lundinc2 commented Sep 8, 2020

/bot run checks

@shubhamkulkarni97
Copy link
Contributor Author

License for newly added files brought in sync with other Espressif port files.

@lundinc2
Copy link
Contributor

lundinc2 commented Sep 8, 2020

/bot run checks

1 similar comment
@lundinc2
Copy link
Contributor

lundinc2 commented Sep 8, 2020

/bot run checks

@mingyue86010 mingyue86010 mentioned this pull request Sep 10, 2020
@lundinc2 lundinc2 merged commit dd2f01e into aws:master Sep 14, 2020
)


target_compile_options(
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 we add more compile options?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There were a bunch of compile errors when common-io is enabled. These compile options fix those errors.

@@ -349,6 +378,7 @@ target_link_libraries(
AFR::pkcs11
AFR::ota_mqtt
AFR::ota_http
AFR::common_io
Copy link
Contributor

Choose a reason for hiding this comment

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

Does OTA need common_io?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OTA does not need common-io and this change is added by mistake. Actually this change was added when @lundinc2 created a PR to enable common-io on esp32 in my personal fork: https://github.com/shubhamkulkarni97/amazon-freertos/pull/1/files

Sorry for overlooking this change.

@shubhamkulkarni97 shubhamkulkarni97 deleted the feature/common_io branch December 14, 2020 13:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants