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

LPC1769 port #5025

Merged
merged 3 commits into from
Oct 26, 2017
Merged

LPC1769 port #5025

merged 3 commits into from
Oct 26, 2017

Conversation

grygorek
Copy link
Contributor

@grygorek grygorek commented Sep 5, 2017

Description

  • LPCXpresso LPC1769 is a similar board as mbed LPC1768. It has a different pinout and different eth phy chip. The blinky example was compiled with IAR and GCC_ARM. The driver for eth phy is not provided and LWIP cannot be included in a build.

  • Update of the SAMR21 Xplained Pro board support to mbed OS 5. The blinky example was build with IAR and GCC_ARM. Other components were not tested.

Status

READY

Migrations

Changes to API
NO

The blinky example compiles and runs.
The board has a different eth phy component than mbed LPC1768. It requires a driver.
@chrissnow
Copy link
Contributor

I have been using the EA LPC1769 board for a while now and it works fine if you build against LPC1768 (including ethernet)

The PHY is different but the driver is basically identical.

@grygorek
Copy link
Contributor Author

grygorek commented Sep 6, 2017

Thanks Chris,
The LPC1768 and LPC1769 are almost the same MCUs. I cant see the difference other than max frequency clock (100MHz vs 120MHz). Not surprised the LPC1768 may works on an EA board.

However the pinout of EA board and mbed boards is different. In eg. the LED is connected to a different pin.

This is my first contribution ever. I am learning how to do the things so, i took it easy :-).

@chrissnow
Copy link
Contributor

I would suggest inheriting the LPC1768 in the target and conditional compile the pin names, less duplication that way.

A couple of other things to bear in mind though..

the CMSIS-DAP implementation doesn't support drag and drop.
the USB-Serial is not connected or enabled.

These two omissions don't make it the most friendly mbed target.

@JojoS62
Copy link
Contributor

JojoS62 commented Sep 6, 2017

the CMSIS-DAP implementation doesn't support drag and drop.
the USB-Serial is not connected or enabled.

The actual rev. D/D1 use a LPC11U35H_501 for the debug probe, so it should be possible to replace the firmware by the DAPLink software to make mbed compatible. And when the MCUXpresso exporter is merged it will be also very easy to use this board with the offline IDE.

USB and Eth have the necessary hardware on board, only the connectors are needed. Maybe not the best solution for an education board, but great for integration in own projects.
Also the target_lpc176x/ethernet_api.c contains the code for PHY LAN8720, so this should work also out of the box.

There are already a few revisions for this board, the new one has a RGB LED with P3_26 blue and P3_25 green. I suggest to add these definitions also to the pinnames.h.

@grygorek
Copy link
Contributor Author

grygorek commented Sep 6, 2017

I would suggest inheriting the LPC1768 in the target and conditional compile the pin names, less duplication that way.

Thats done. The LPC1769 will point to mbed LPC1769.

Also the target_lpc176x/ethernet_api.c contains the code for PHY LAN8720, so this should work also out of the box.

That's right. It turned out the problem with the LWIP and ethernet was not this driver but the conditional compile in lpc17_emac.c, which failed with TARGET_LPC1769 and not TARGET_LPC1768. I updated this.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 19, 2017

Hi @grygorek . Thanks for the contribution.

Can you share testing results for these 2 updates ? It would be better if you could split as those 2 are not related changeset (adding lpc1769, update to SAM target)

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 19, 2017

cc @sg-

@grygorek
Copy link
Contributor Author

grygorek commented Sep 27, 2017

Hi,
As chrissnow pointed out the board does not have CMSIS-DAP with mass storage enabled. I assume the test scripts try to program the board this way. Not sure if there is an alternative way the scripts could use.

I was able to program the NXP board using jtag and run tests using the mbedhtrun. These were two tests only - mbedtls multi and events timing. They passed. It will be painful to run all the tests that way.
Do you want me to paste the console output of the two tests here?

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 28, 2017

Can you split this PR to 2 parts , one would be:
Update of the SAMR21 Xplained Pro board support to mbed OS 5. The blinky example was build with IAR and GCC_ARM. Other components were not tested ?

You can keep here LPC addition.

Can you then sign please https://os.mbed.com/contributor_agreement/

@grygorek grygorek changed the title LPC1769 port & SAMR21 update LPC1769 port Sep 28, 2017
@grygorek
Copy link
Contributor Author

I have reverted the SAM commit. Ill keep it as a separate branch for the moment.
Agreement signed already

I run the blinky example from GCC_ARM and IAR.
Also run two more tests from IAR

  • mbedtls multi
  • events timing
    Other components not tested.

Target of LPC1769 links to mbed LPC1768.
The PinNames.h has conditional compile for the pin names.
LWIP lpc17xx emac driver modified to allow LPC1769 target
@@ -243,6 +243,17 @@
"features": ["LWIP"],
"device_name": "LPC1768"
},
"LPC1769": {
"inherits": ["LPCTarget"],
Copy link
Contributor

Choose a reason for hiding this comment

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

should this inherit from lpc1768 ? no extra label on the line 249 needed then?

I believe that is what @chrissnow was suggesting earlier?

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 13, 2017

Thanks for signing CLA.

The only question is about inheritance (the relationship between lpc1768 and lpc1769). Otherwise this PR looks f ine

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 13, 2017

/morph build

@@ -0,0 +1,172 @@
/* Linker script for mbed LPC1769 */
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this file required? Should it not use the LPC1768 one? It looks like it may have come from the xbed port unnecessarily?

If it is required please can you update it to to include my recent changes to LPC1768 regarding CRP and bootloader as in #5038.

@chrissnow
Copy link
Contributor

@grygorek I think you made the same mistake I did here
#4640
You need to rebase rather than merge to fix the conflict.
@theotherjimmy helped me before, that link might explain things enough so you don't make things worse like I did!

@grygorek
Copy link
Contributor Author

@chrissnow Thanks for warning ;-). The conflict is in the comment I have added to the linker file. I guess it will be easier if i revert that single change to avoid the conflict at all.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 18, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 18, 2017

Build : SUCCESS

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

Skipping test trigger, missing label 'NEED CI'

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 19, 2017

@chrissnow happy with this patch?

@theotherjimmy
Copy link
Contributor

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 23, 2017

Build : FAILURE

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

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 23, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 23, 2017

Build : SUCCESS

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

Triggering tests

/morph test
/morph uvisor-test

@mbed-ci
Copy link

mbed-ci commented Oct 23, 2017

@edcorazza
Copy link

Sorry to revive this, but does mbed OS 5 work with the LPCxpresso1769 which uses the LAN8720? Are there any modifications I need to make to get this to work, or is it just a matter of compiling the program in the same way I would any other? Would be good to know before shelling out on it. Cheers

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.

None yet

8 participants