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

[TrackerM] Add platform support #2492

Merged
merged 31 commits into from
Aug 16, 2022
Merged

Conversation

keeramis
Copy link
Contributor

@keeramis keeramis commented Jul 25, 2022

Contributors

Description

Adds support for Tracker-M platform

Solution

Add new PLATFORM_ID for trackerm platform, largely based off of P2 module/platform definitions

Steps to Test

Build using new platform and test with trackerm hardware:

make PLATFORM=trackerm APP=tinker clean all

References

SC-105590
SC-107631


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

if (rtsPin_ != PIN_INVALID) {
Pinmux_Config(hal_pin_to_rtl_pin(rtsPin_), PINMUX_FUNCTION_UART_RTSCTS);
PAD_PullCtrl(hal_pin_to_rtl_pin(rtsPin_), GPIO_PuPd_UP);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change was needed for the UART hardware flow control to work as expected.

Copy link
Member

Choose a reason for hiding this comment

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

hal/src/trackerm/include.mk Outdated Show resolved Hide resolved
Copy link
Member

@avtolstoy avtolstoy left a comment

Choose a reason for hiding this comment

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

bootloader/src/main.c Outdated Show resolved Hide resolved
build/module.mk Outdated Show resolved Hide resolved
dynalib/inc/dynalib.h Outdated Show resolved Hide resolved
dynalib/inc/module_info.inc Outdated Show resolved Hide resolved
user/tests/wiring/sleep20/sleep20.cpp Outdated Show resolved Hide resolved
user/tests/wiring/spi_master_slave/spi_slave/spi_slave.cpp Outdated Show resolved Hide resolved
wiring_globals/src/spark_wiring_gpio.cpp Outdated Show resolved Hide resolved
bootloader/makefile Outdated Show resolved Hide resolved
bootloader/prebootloader/makefile Outdated Show resolved Hide resolved
hal/src/rtl872x/hal_platform_rtl8721x_config.h Outdated Show resolved Hide resolved
hal/src/rtl872x/pinmap_impl.h Outdated Show resolved Hide resolved
hal/src/trackerm/hal_platform_config.h Outdated Show resolved Hide resolved
hal/src/trackerm/hal_platform_config.h Outdated Show resolved Hide resolved
hal/src/trackerm/hal_platform_config.h Outdated Show resolved Hide resolved
hal/src/trackerm/network/network.cpp Outdated Show resolved Hide resolved
system/src/system_sleep.cpp Outdated Show resolved Hide resolved
hal/shared/demux.h Outdated Show resolved Hide resolved
@keeramis
Copy link
Contributor Author

See also CI failures.
Also add to https://github.com/particle-iot/device-os/blob/develop/system/src/system_cloud_internal.cpp#L1113

@avtolstoy Since tracker-m support cellular, it's not needed to mention it in the conditions there, right?

dynalib/inc/dynalib.h Outdated Show resolved Hide resolved
@keeramis keeramis force-pushed the SC105590/tracker-m-platform branch 2 times, most recently from b6f98a2 to cea631c Compare August 4, 2022 05:23
@keeramis keeramis added this to the 5.0.0 milestone Aug 4, 2022
Copy link
Member

@XuGuohui XuGuohui left a comment

Choose a reason for hiding this comment

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

@keeramis There is comments need to be resovled, most of them are related to using HAL_PLATFORM_RTL872X.

hal/src/trackerm/network/network.cpp Outdated Show resolved Hide resolved
hal/src/trackerm/platform_ncp_quectel.cpp Outdated Show resolved Hide resolved
user/inc/Arduino.h Show resolved Hide resolved
hal/src/rtl872x/hal_platform_rtl8721x_config.h Outdated Show resolved Hide resolved
hal/inc/hal_platform.h Outdated Show resolved Hide resolved
@keeramis keeramis force-pushed the SC105590/tracker-m-platform branch 3 times, most recently from ac290e9 to bcb67e8 Compare August 10, 2022 06:50
@keeramis keeramis requested a review from XuGuohui August 10, 2022 14:13
@keeramis keeramis force-pushed the SC105590/tracker-m-platform branch from 3cd1f95 to b54b421 Compare August 10, 2022 14:44
hal/src/rtl872x/gsm0710muxer/platform.h Outdated Show resolved Hide resolved
hal/src/rtl872x/gsm0710muxer/platform.h Outdated Show resolved Hide resolved
hal/src/rtl872x/platform_headers.h Outdated Show resolved Hide resolved
if (rtsPin_ != PIN_INVALID) {
Pinmux_Config(hal_pin_to_rtl_pin(rtsPin_), PINMUX_FUNCTION_UART_RTSCTS);
PAD_PullCtrl(hal_pin_to_rtl_pin(rtsPin_), GPIO_PuPd_UP);
}
Copy link
Member

Choose a reason for hiding this comment

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

hal/src/trackerm/network/network.cpp Outdated Show resolved Hide resolved
hal/src/trackerm/network/network.cpp Outdated Show resolved Hide resolved
hal/src/trackerm/ota_flash_hal.cpp Outdated Show resolved Hide resolved
hal/src/trackerm/platform_ncp_quectel.cpp Show resolved Hide resolved
hal/src/trackerm/platform_ncp_quectel.cpp Outdated Show resolved Hide resolved
hal/src/tron/network/network.cpp Show resolved Hide resolved
@keeramis keeramis force-pushed the SC105590/tracker-m-platform branch 2 times, most recently from 7240d5f to 9e01d92 Compare August 11, 2022 20:35
uint8_t deviceId[HAL_DEVICE_ID_SIZE] = {};
hal_get_device_id(deviceId, sizeof(deviceId));
uint8_t* mac = deviceId + HAL_DEVICE_ID_SIZE - 6;
mac[5] += 3;
Copy link
Member

Choose a reason for hiding this comment

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

Nit (can be done in a separate PR): let's add deviceid_hal_impl.h for all platforms (included from deviceid_hal.h, see other _impl.h headers as an example) and for rtl872x add a set of defines for MAC addresses to avoid having to use magic numbers:

HAL_DEVICE_MAC_WIFI_STA = 0
HAL_DEVICE_MAC_WIFI_AP  = 1
HAL_DEVICE_MAC_BLE = 2
HAL_DEVICE_MAC_ETHERNET = 3

Copy link
Member

Choose a reason for hiding this comment

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

Let's leave it as-is and I'll get the deviceid hal refactored along with getting the BLE MAC address.

Copy link
Member

Choose a reason for hiding this comment

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

Yup, let's do that 👍

@avtolstoy
Copy link
Member

@keeramis I've pushed a commit as well to resolve the IRQn issues.

@avtolstoy avtolstoy force-pushed the SC105590/tracker-m-platform branch from 382b51c to bc26a6d Compare August 16, 2022 20:17
@avtolstoy avtolstoy merged commit 7f578c5 into develop Aug 16, 2022
@avtolstoy avtolstoy deleted the SC105590/tracker-m-platform branch August 16, 2022 22:00
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.

6 participants