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

[NuMaker] Support CAN and fix PWM CLK error #3104

Merged
merged 9 commits into from
Nov 3, 2016
Merged

Conversation

cyliangtw
Copy link
Contributor

Description

To support PFM_NUC472 & PFM_M453 CAN function.
To fix PFM_NUC472 PWM1 CLK source setting error to resolve PWM failure in ci-test-shield of
Nuvoton NUMAKER_PFM_NUC472 #3029

Status

READY

@@ -38,7 +38,7 @@
#define DEVICE_SPI_ASYNCH 1
#define DEVICE_SPISLAVE 1

#define DEVICE_CAN 0
//#define DEVICE_CAN 1
Copy link
Contributor

Choose a reason for hiding this comment

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

dead code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Define in device.h is legacy, so I follow most platforms to define CAN in "device_has" field of targets.json .

Copy link
Contributor

Choose a reason for hiding this comment

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

That's correct but we should not leave dead code in the sources. Remove it completely?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed CAN part in commit# 33cfe1f, we will remove others in next PR.

static void can_irq(CANName name, int id)
{

CAN_T *can = (CAN_T *)NU_MODBASE(name);
Copy link
Contributor

Choose a reason for hiding this comment

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

misaligned code in this file, tabs used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit# 6889c13

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 27, 2016

how was this tested? Any results to be shared?

@cyliangtw
Copy link
Contributor Author

I created NuMaker-mbed-can sample code and published it at: https://developer.mbed.org/teams/Nuvoton/code/NuMaker-mbed-can/
It could be built as sender img or receiver img.
To burn sender img into one NUC472 or M453 board, to burn receiver img into another NUC472 or M453 board. Then using 2 wires to connect these 2 boards CAN port with a 120 ohm.
The receiver will show LED blinking & print out as while receive one message object, uart log as below:

Read ID=     1AC, Type=STD, DLC=8,Data=00,00,00,00,00,00,00,00,
Read ID=     1AC, Type=STD, DLC=8,Data=01,01,01,01,01,01,01,01,
Read ID=     1AC, Type=STD, DLC=8,Data=02,02,02,02,02,02,02,02,
Read ID=     1AC, Type=STD, DLC=8,Data=00,00,00,00,00,00,00,00,
Read ID=     1AC, Type=STD, DLC=8,Data=01,01,01,01,01,01,01,01,
Read ID=     1AC, Type=STD, DLC=8,Data=02,02,02,02,02,02,02,02,

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 28, 2016

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 966

All builds and test passed!

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

Minor things about the code style. Other than that, LGTM


CAN_EnterInitMode((CAN_T*)obj->can, ((enable != 0 )? CAN_CON_IE_Msk :0) );

// ((CAN_T *)(obj->can))->CON = (((CAN_T *)(obj->can))->CON ) | ((enable != 0 )? CAN_CON_IE_Msk :0);
Copy link
Contributor

Choose a reason for hiding this comment

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

can you remove this dead code, below line 176 and 177 also.


if(can->STATUS & CAN_STATUS_TXOK_Msk) {
can->STATUS &= ~CAN_STATUS_TXOK_Msk; /* Clear Tx Ok status*/
can0_irq_handler(can_irq_ids[id], IRQ_TX);
Copy link
Contributor

Choose a reason for hiding this comment

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

misaligned, some lines are . can_init, can_free for instance contain lot of misaligned lines

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed dead code of can_api.c in commit# da8fd8b
Fixed misaligned lines in commit# a044a65

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 1, 2016

/morph test

@mbed-bot
Copy link

mbed-bot commented Nov 1, 2016

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 980

All builds and test passed!

@sg- sg- merged commit 0ace795 into ARMmbed:master Nov 3, 2016
oter pushed a commit to oter/mbed-os that referenced this pull request Nov 21, 2016
Release mbed OS 5.2.2 and mbed lib v129

Known issues in this release

There is currently a DNS resolution failure in Thread mode with this release. This causes a failure in the
mbed-os-example-client. This will be fixed in a subsequent release. This can be worked around by reverting
to mbed-os-5.2.0

Ports for Upcoming Targets

3011: Add u-blox Sara-N target. ARMmbed#3011
3099: MAX32625 ARMmbed#3099
3151: Add support for FRDM-K82F ARMmbed#3151
3177: New mcu k22512 fixing pr 3136 ARMmbed#3177

Fixes and Changes

2990: [tools] Parallel building of tests ARMmbed#2990
3008: NUCLEO_F072RB: Fix wrong timer channel number on pwm PB_5 pin ARMmbed#3008
3013: STM32xx - Change how the ADC internal pins are checked before pinmap_ ARMmbed#3013
3023: digital_loop tests update for STM32 ARMmbed#3023
3041: [nRF5] - added implementation of API of serial port flow control configuration. ARMmbed#3041
3092: [tools + tests] Adding parallelized build option for iar and uvision exporters ARMmbed#3092
3084: [nrf5] fix in Digital I/O : a gpioe pin was uninitialized badly ARMmbed#3084
3009: TRNG enabled. TRNG APIs implemented. REV A/B/C/D flags removed. Warnings removed ARMmbed#3009
3139: Handle [NOT_SUPPORTED] exception in make.py ARMmbed#3139
3074: Target stm init gcc alignement ARMmbed#3074
3140: [tests] Replacing getchar with RawSerial getc in greentea-client ARMmbed#3140
3158: Added support for 6lowpan PAN ID filter to mbed mesh api configuration ARMmbed#3158
2988: Update of can_api.c fixing ARMmbed#2987 ARMmbed#2988
3175: Updating IAR definition for the NCS36510 for IAR EW v7.8 ARMmbed#3175
3170: [tests] Preventing test from printing before Greentea __sync ARMmbed#3170
3169: [Update of ARMmbed#3014] Usb updates ARMmbed#3169
3143: CFStore fix needed for the Cloud Client ARMmbed#3143
3135: lwip - Fix memory leak in k64f cyclic-buffer overflow ARMmbed#3135
3048: Make update.py test compile examples prior to updating mbed-os version. ARMmbed#3048
3162: lwip/nsapi - Clean up warnings in network code ARMmbed#3162
3161: nsapi - Add better heuristic for the default record of DNS queries ARMmbed#3161
3173: [Exporters] Add a device_name to microbit entry in targets.json ARMmbed#3173
3072: i2c_loop tests update for STM32 ARMmbed#3072
2958: Allowing mbed_app.json files to be discovered for tests. ARMmbed#2958
2969: [nRF52] - switch irq priorities of driver handlers to the lowest level ARMmbed#2969
3078: lwip: Allow several configuration macros to be set externally (bis) ARMmbed#3078
3165: Add address type checks to NanostackInterface ARMmbed#3165
3166: nsapi_dns: Provide 2 IPv6-hosted default servers ARMmbed#3166
3171: [tools] Fixing project.py -S printing problem ARMmbed#3171
3172: [Exporters] New export-build tests ARMmbed#3172
3184: ARMmbed#3183 Compiler warning in trng_api.c with K64F  ARMmbed#3184
3185: Update tests to fix build failures. Also make the code similar to oth ARMmbed#3185
3104: [NuMaker] Support CAN and fix PWM CLK error ARMmbed#3104
3182: Exporter documentation ARMmbed#3182
3186: MultiTech mDot - add back SPI3 pins ARMmbed#3186
3187: [Export-Make] Use internal class variable for resolving templates in makefiles ARMmbed#3187
3195: [Exporters - Make-based] Quote the shell call in mkdir and rmdir ARMmbed#3195
3204: [Export build-test] Directory traversal error ARMmbed#3204
3189: [Exporters - Make-based] Force make exporter to search PATH for compilers ARMmbed#3189
3200: Using Popen for uVision and unifying the structure of the build function ARMmbed#3200
3075: nsapi - Add standardized return types for size and errors ARMmbed#3075
3221: u-blox odin w2 drivers update ARMmbed#3221
aisair pushed a commit to aisair/mbed that referenced this pull request Apr 30, 2024
Ports for Upcoming Targets

3011: Add u-blox Sara-N target. ARMmbed/mbed-os#3011
3099: MAX32625 ARMmbed/mbed-os#3099
3151: Add support for FRDM-K82F ARMmbed/mbed-os#3151
3177: New mcu k22512 fixing pr 3136 ARMmbed/mbed-os#3177

Fixes and Changes

3008: NUCLEO_F072RB: Fix wrong timer channel number on pwm PB_5 pin ARMmbed/mbed-os#3008
3013: STM32xx - Change how the ADC internal pins are checked before pinmap_ ARMmbed/mbed-os#3013
3041: [nRF5] - added implementation of API of serial port flow control configuration. ARMmbed/mbed-os#3041
3084: [nrf5] fix in Digital I/O : a gpioe pin was uninitialized badly ARMmbed/mbed-os#3084
3009: TRNG enabled. TRNG APIs implemented. REV A/B/C/D flags removed. Warnings removed ARMmbed/mbed-os#3009
3074: Target stm init gcc alignement ARMmbed/mbed-os#3074
2988: Update of can_api.c fixing #2987 ARMmbed/mbed-os#2988
3173: [Exporters] Add a device_name to microbit entry in targets.json ARMmbed/mbed-os#3173
2969: [nRF52] - switch irq priorities of driver handlers to the lowest level ARMmbed/mbed-os#2969
3184: #3183 Compiler warning in trng_api.c with K64F  ARMmbed/mbed-os#3184
3104: [NuMaker] Support CAN and fix PWM CLK error ARMmbed/mbed-os#3104
3186: MultiTech mDot - add back SPI3 pins ARMmbed/mbed-os#3186
3075: nsapi - Add standardized return types for size and errors ARMmbed/mbed-os#3075
3221: u-blox odin w2 drivers update ARMmbed/mbed-os#3221
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.

5 participants