Skip to content

NRF52 : Fix UART RTS initialization #8474

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

Merged
merged 1 commit into from
Oct 24, 2018

Conversation

naveenkaje
Copy link
Contributor

@naveenkaje naveenkaje commented Oct 18, 2018

The pre-processor based macro check #if evaluates all enums as
0 and hence the code within #if does not get compiled. Hence
move this to a run-time check where the pin variable can be
correctly evaluated.

This is a follow on patch to:
#8046
The above PR does not work for NRF52840_DK and needs this fix.

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

@naveenkaje
Copy link
Contributor Author

@SenRamakri @c1728p9

@cmonr
Copy link
Contributor

cmonr commented Oct 18, 2018

This breaks NRF52840_DK and needs this fix.

The first 'this'. Do you mean the enum preprocessor issue?

@cmonr cmonr requested a review from marcuschangarm October 18, 2018 22:06
@naveenkaje
Copy link
Contributor Author

@cmonr Sorry for the cryptic message. I changed it to "The above PR does not work for NRF52840_DK and needs this fix."

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 22, 2018

LGTM (cant approve as github is having issues), will start CI

/morph build

1 similar comment
@0xc0170
Copy link
Contributor

0xc0170 commented Oct 22, 2018

LGTM (cant approve as github is having issues), will start CI

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 22, 2018

Build : FAILURE

Build number : 3424
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8474/

@mbed-ci
Copy link

mbed-ci commented Oct 22, 2018

Build : FAILURE

Build number : 3425
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8474/

@naveenkaje naveenkaje force-pushed the NRF_RTS_Followon_Fix branch from b7b69da to 1d4ef69 Compare October 22, 2018 16:26
@cmonr
Copy link
Contributor

cmonr commented Oct 22, 2018

@naveenkaje Was this a rebase, or were the failure issues fixed and squashed? Hard to tell.

@naveenkaje naveenkaje force-pushed the NRF_RTS_Followon_Fix branch from 1d4ef69 to ba132fe Compare October 22, 2018 16:30
@naveenkaje
Copy link
Contributor Author

@cmonr I had originally changed only targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/reloc_vector_table.c, but during CI I noted that the following files needed the RTS pin definition

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/TARGET_DELTA_DFBM_NQ620/PinNames.h
targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/TARGET_MTB_UBLOX_NINA_B1/PinNames.h
targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/TARGET_RBLAB_BLENANO2/PinNames.h
targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/TARGET_UBLOX_EVA_NINA/PinNames.h

Hence I modified them and rebased on top of master.
Hope it's clear.

@cmonr
Copy link
Contributor

cmonr commented Oct 22, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 22, 2018

Build : FAILURE

Build number : 3430
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8474/

@cmonr
Copy link
Contributor

cmonr commented Oct 23, 2018

Interesting. Looks like the last build issue is only with the DELTA_DFBM_NQ620 target.

@naveenkaje
Copy link
Contributor Author

Thanks @cmonr

It is caused due to multiply defined mbed_sdk_init() for that target.

TESTS/mbed_platform/system_reset/main.cpp
[DEBUG] Return: 0
Link: system_reset_application
Link: /usr/local/ARM_Compiler_5.06u3/bin/armlink --via /builds/ws/mbed-os-build-matrix/3430/DELTA_DFBM_NQ620_ARM/sources/mbed-os/BUILD/tests/DELTA_DFBM_NQ620/ARM/TESTS/mbed_platform/system_reset/.link_options.txt
[DEBUG] Return: 1
[DEBUG] Errors: Error: L6200E: Symbol mbed_sdk_init multiply defined (by BUILD/tests/DELTA_DFBM_NQ620/ARM/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/reloc_vector_table.o and BUILD/tests/DELTA_DFBM_NQ620/ARM/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/TARGET_DELTA_DFBM_NQ620/mbed_overrides.o).

Looking at the history, 56cf092 has brought this call for that target. The function is not doing anything particularly useful. It is declaring a couple of local variables. I propose to delete this file.

The preprocessor based macro check #if evaluates all
enums as 0 and hence the code does not get compiled.
Since move this to a runtime check where the pin variable
can be correctly evaluated.

Delete mbed_overrides.c as it has a target specific mbed_sdk_init() to
resolve linking problem.

This is a follow on patch to:
ARMmbed#8046
@cmonr
Copy link
Contributor

cmonr commented Oct 23, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 23, 2018

Build : SUCCESS

Build number : 3446
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/8474/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Oct 23, 2018

@mbed-ci
Copy link

mbed-ci commented Oct 23, 2018

@cmonr
Copy link
Contributor

cmonr commented Oct 23, 2018

Job config fixed.
/morph test

1 similar comment
@cmonr
Copy link
Contributor

cmonr commented Oct 23, 2018

Job config fixed.
/morph test

@mbed-ci
Copy link

mbed-ci commented Oct 24, 2018

@cmonr
Copy link
Contributor

cmonr commented Oct 24, 2018

Waiting on new greentea tests. Should be about an hour until complete.

@0xc0170 0xc0170 merged commit ab6429f into ARMmbed:master Oct 24, 2018
naveenkaje pushed a commit to naveenkaje/mbed-os that referenced this pull request Dec 14, 2018
This change was based on original version of ARMmbed#8474.
After the reviews, the it changed from pre-processor based check to
code based check. Do the same here in this branch
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.

7 participants