-
Notifications
You must be signed in to change notification settings - Fork 3k
Fastmodels support: add FVP_MPS2 targets to mbed os #6862
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
Conversation
@bulislaw Could you review this PR, or add the people who can review this RP. Seems I don't have permission to raise review request |
@ARMmbed/mbed-os-maintainers can we add @jamesbeyond to the ArmMbed org please? |
@jamesbeyond some checks are failing. Also where did you get all this code from? What about tools changes are they coming in separate PR? |
@bulislaw Travis failing seem because of Travis server issue. I am not sure how I can re-trigger Travis, This PR only about add the Fastmodel targets to mbed os. Most of the code I got from the hardware ARM_MPS2_Mx target drivers, I had some modification to suit the models where necessary The changes for the tools will come in separate PRs |
@bulislaw Qinghao is already a member of mbed-staff..Only a select few people can add reviewers :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've skimmed the files, it looks good.
targets/targets.json
Outdated
"FVP_MPS2_M0": { | ||
"inherits": ["ARM_FM_Target"], | ||
"core": "Cortex-M0", | ||
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to ARM_FM_Target
targets/targets.json
Outdated
@@ -4008,5 +4008,60 @@ | |||
"detect_code": ["7013"], | |||
"release_versions": ["5"], | |||
"bootloader_supported": true | |||
}, | |||
"ARM_FM_Target": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the redundant Target
targets/targets.json
Outdated
"inherits": ["ARM_FM_Target"], | ||
"core": "Cortex-M0", | ||
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"], | ||
"extra_labels": ["ARM_FM", "FVP_MPS2", "FVP_MPS2_M0"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move "ARM_FM" (should be the parent name) and "FVP_MPS2"
to the parent, and change this to an extra_labels_add
targets/targets.json
Outdated
"core": "Cortex-M0", | ||
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"], | ||
"extra_labels": ["ARM_FM", "FVP_MPS2", "FVP_MPS2_M0"], | ||
"OUTPUT_EXT": "elf", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to parent.
targets/targets.json
Outdated
"extra_labels": ["ARM_FM", "FVP_MPS2", "FVP_MPS2_M0"], | ||
"OUTPUT_EXT": "elf", | ||
"macros": ["CMSDK_CM0","CMSIS_VECTAB_VIRTUAL", "CMSIS_VECTAB_VIRTUAL_HEADER_FILE=\"cmsis_nvic.h\""], | ||
"device_has": ["AACI", "ANALOGIN", "CLCD", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "SERIAL", "SERIAL_FC", "SPI", "SPISLAVE", "TSC"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't duplicate the devices_has of the parent. If anything is added here, add it with extra_labels_add
.
create a new platform folder TARGET_ARM_FM add general drivers files for FVP_MPS2
add cmsis drivers and toolchain scripts for FVP_MPS2_M3
add cmsis drivers and toolchain scripts for FVP_MPS2_M4
add cmsis drivers and toolchain scripts for FVP_MPS2_M0
add cmsis drivers and toolchain scripts for FVP_MPS2_M0P
add cmsis drivers and toolchain scripts for FVP_MPS2_M7
add ARM_FM top level category add second level parent FVP_MPS2 inherits ARM_FM add each target ( M0 M0P M3 M4 M7 ) inherits FVP_MPS2
77d1929
to
953a735
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The level of formatting in the majority of these files does not meet the coding guidelines, they all need to be tidied up.
} ADCName; | ||
|
||
typedef enum { | ||
SPI_0 = (int)MPS2_SSP1_BASE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation levels
#endif | ||
|
||
typedef enum { | ||
PIN_INPUT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 4 spaces
|
||
typedef enum { | ||
// MPS2 EXP Pin Names | ||
EXP0 = 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be 4 spaces
|
||
error = 0; | ||
val = SMSC9220->MAC_CSR_CMD; | ||
if(!(val & ((unsigned int)1 << 31))) { // Make sure there's no pending operation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check the guidelines to see if there is supposed to be a space after 'if'
if(!timedout) { | ||
error = 1; | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be -
if(!timedout) {
error = 1;
} else {
...
}
|
||
if(smsc9220_reset_phy()) { | ||
error = TRUE; | ||
return error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this error return immediately but the ones above don't? Also if returning immediately why is the error variable even used ? Why not just return TRUE ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Through this code was not originally from me, I guess that is for readability.
let people know this returns an error value, rather than miss leading people by TRUE implicates successful.
|
||
int ethernet_write(const char *data, int size) | ||
{ | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
|
||
int ethernet_send() | ||
{ | ||
return 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation
@@ -0,0 +1,140 @@ | |||
/* mbed Microcontroller Library |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting in this file is horrible, please conform to the coding guidelines
@@ -0,0 +1,241 @@ | |||
/* mbed Microcontroller Library |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File needs reformatting to meet coding standards
@theotherjimmy can you re-review the changes to the target stuff on Monday when you are back please |
Hi @adbridge, all of your comments about formatting been addressed, Could you review again? |
74264a0
to
aab82a7
Compare
targets/targets.json
Outdated
"inherits": ["ARM_FM"], | ||
"public": false, | ||
"supported_toolchains": ["GCC_ARM", "ARM", "IAR"], | ||
"extra_labels_add": ["FVP_MPS2"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant. This already happens because of the target name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't realize that was automatically added. Now got all of these redundant "extra_label_add" removed. can you review pls @theotherjimmy
targets/targets.json
Outdated
"FVP_MPS2_M0": { | ||
"inherits": ["FVP_MPS2"], | ||
"core": "Cortex-M0", | ||
"extra_labels_add": ["FVP_MPS2_M0"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant. This already happens because of the target name.
targets/targets.json
Outdated
"FVP_MPS2_M0P": { | ||
"inherits": ["FVP_MPS2"], | ||
"core": "Cortex-M0+", | ||
"extra_labels_add": ["FVP_MPS2_M0P"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant. This already happens because of the target name.
targets/targets.json
Outdated
"FVP_MPS2_M3": { | ||
"inherits": ["FVP_MPS2"], | ||
"core": "Cortex-M3", | ||
"extra_labels_add": ["FVP_MPS2_M3"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant. This already happens because of the target name.
targets/targets.json
Outdated
"FVP_MPS2_M4": { | ||
"inherits": ["FVP_MPS2"], | ||
"core": "Cortex-M4", | ||
"extra_labels_add": ["FVP_MPS2_M4"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant. This already happens because of the target name.
targets/targets.json
Outdated
"FVP_MPS2_M7": { | ||
"inherits": ["FVP_MPS2"], | ||
"core": "Cortex-M7", | ||
"extra_labels_add": ["FVP_MPS2_M7"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant. This already happens because of the target name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
304b584
@adbridge could you review again pls |
error = 1; | ||
} | ||
else | ||
} else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ } needed around single statements
/morph build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question regarding empty functions in HAL.
{ | ||
} | ||
void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, PinName txflow) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why flow control is emtpy? is it enabled? will it be supported?
Similar is to pinmap functionality (assume that target does not have any pinmap functionality, neither break set/clear) thus they are emptY?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the fastmodels and the hardware it modeling after don't support for flow control.
The details can be found in bellow reference guide:
Build : FAILUREBuild number : 2099 |
@studavekar Please review the latest build ( |
Hi @studavekar, any update on this build error? |
Should be resolved now. |
Build : SUCCESSBuild number : 2113 Triggering tests/morph test |
Test : SUCCESSBuild number : 1914 |
Exporter Build : SUCCESSBuild number : 1748 |
Description
add TARGET_ARM_FM top level folder in targets
add TARGET_FVP_MPS2 platform category
add following targets to the FVP_MPS2 category
add all necessary drivers for FVP_MPS2 platfrom and each target
add toolchian scripts for ARM, GCC_ARM and IAR
modify target.json enable mbed for fastmodel FVP_MPS2 targets
Pull request type