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

Support Nuvoton's M480 target #446

Closed
wants to merge 3 commits into from
Closed

Support Nuvoton's M480 target #446

wants to merge 3 commits into from

Conversation

ccli8
Copy link
Contributor

@ccli8 ccli8 commented Jul 6, 2017

This PR is to support Nuvoton's M480 series. A target NUMAKER_PFM_M487 of the series is in PR (ARMmbed/mbed-os#4608).

@Patater
Copy link
Contributor

Patater commented Jul 10, 2017

Thanks very much for your PR. We'll review and get back with you soon.

Copy link
Contributor

@Patater Patater left a comment

Choose a reason for hiding this comment

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

Thanks again for the PR. This looks almost done. Yet to review is the target linker script in your PR to mbed OS.

* FLASH_LENGTH_MIN = min(FLASH_LENGTH_i) for i in family
* SRAM_LENGTH_MIN = min(SRAM_LENGTH_i) for i in family */
#define FLASH_LENGTH_MIN 0x40000
#define SRAM_LENGTH_MIN 0x20000
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Does the M480-family target with the least amount of SRAM have 128 KiB of SRAM available continuously starting at address 0x20000000?
  • Does the M480-family target with the least amount of flash have 256 KiB of flash available continuously starting at address 0x00000000?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Patater

Does the M480-family target with the least amount of SRAM have 128 KiB of SRAM available continuously starting at address 0x20000000?

I fixed it to 96KiB. Please refer to 4d97759.

Does the M480-family target with the least amount of flash have 256 KiB of flash available continuously starting at address 0x00000000?

Yes.

*/
#include <uvisor.h>

/* Abstract from M480.h */
Copy link
Contributor

Choose a reason for hiding this comment

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

uVisor must have a minimum of platform-dependent code. Please remove the addition of this file from this commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Patater According to uvisor > core > debug > src > debug.c, default_putc() is allowed to override. Per our experience, it could help development as uvisor core debug message could emit via USB VCOM rather than semihosting in debug mode. Besides, the platform beetle already has the same override.

/* During the porting process the implementation of this function can be
 * overwritten to provide a different mechanism for printing messages (e.g. the
 * UART port instead of semihosting). */
#define DEBUG_MAX_BUFFER 128
uint8_t g_buffer[DEBUG_MAX_BUFFER];
int g_buffer_pos;

UVISOR_WEAK void default_putc(uint8_t data)
{
    if (g_buffer_pos < (DEBUG_MAX_BUFFER - 1)) {
        g_buffer[g_buffer_pos++] = data;

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @ccli8,

We are working on making debugging without semihosting easier. We unfortunately can't accept the UART driver for M480 into uVisor, but you are free to continue overriding default_putc out-of-tree.

Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Patater OK. I remove overriding default_putc. Please check 59b68b6.

@ccli8
Copy link
Contributor Author

ccli8 commented Jul 28, 2017

How about status?

@Patater
Copy link
Contributor

Patater commented Jul 31, 2017

After ARMmbed/mbed-os#4608 is rebased on latest mbed OS, we'll test uVisor on M487. If all goes well, we'll merge this PR.

@Patater
Copy link
Contributor

Patater commented Aug 2, 2017

@ccli8

What testing has been done so far with this PR on your end?

If I'd like to run a debugger, are there instructions available someplace describing how to set up a debugger for the M487?

Thanks

@ccli8
Copy link
Contributor Author

ccli8 commented Aug 4, 2017

@Patater

What testing has been done so far with this PR on your end?

I test on the examples you give by adding NUMAKER_PFM_M487's public ACL and enlarging uVisor .bss:

If I'd like to run a debugger, are there instructions available someplace describing how to set up a debugger for the M487?

I also create a uVisor example based on yours for our target. It mentions how to debug uVisor program in Keil uVision built with GCC toolchain on our target.

@Patater
Copy link
Contributor

Patater commented Aug 4, 2017

Thanks for sharing your demo application and providing instructions on setting up debugging.

I've run all our uVisor tests with this target, using this PR and the mbed OS PR. All tests pass. Nice work!

I am having some issues with the UART, however. I'll post feedback on the mbed OS PR.

@Patater
Copy link
Contributor

Patater commented Aug 14, 2017

Manually squashed and merged

@ccli8 Thanks!

@Patater Patater closed this Aug 14, 2017
@ccli8
Copy link
Contributor Author

ccli8 commented Aug 15, 2017

Hi @Patater , if we would like built M487 uVisor core pre-installed in Mbed OS, like K64F:

mbed-os\features\FEATURE_UVISOR\targets\TARGET_UVISOR_SUPPORTED\TARGET_MCU_K64F\TARGET_RELEASE\TARGET_M4\libconfiguration_kinetis_cortex_m4_0x1fff0000.a
mbed-os\features\FEATURE_UVISOR\targets\TARGET_UVISOR_SUPPORTED\TARGET_MCU_K64F\TARGET_DEBUG\libconfiguration_kinetis_cortex_m4_0x1fff0000.a

Did I add NUMAKER_PFM_M487.m480 in Makefile and send a PR, or there is another flow you define?

mbed-os\features\FEATURE_UVISOR\importer\Makefile

@Patater
Copy link
Contributor

Patater commented Aug 15, 2017

Hi @ccli8

All we have to do is release the next version of uVisor. I have started working on the PR at ARMmbed/mbed-os#4907. Please have a look.

@ccli8
Copy link
Contributor Author

ccli8 commented Aug 15, 2017

@Patater Thanks for your information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants