Skip to content

CM3DS Maintenance Pull Request: Bug fixes (1/4) #6167

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 2 commits into from
Feb 27, 2018

Conversation

hug-dev
Copy link
Contributor

@hug-dev hug-dev commented Feb 22, 2018

This pull request contains bug fixes for the CM3DS target.
It is the pull request 1 among the 4 concerning CM3DS Maintenance. Please check #6119 for the full scope.

Other pull requests regarding this target:

minosgalanakis and others added 2 commits February 21, 2018 17:51
This patch fixes a memory bug. `eth_arch_enetif_init` method call
would attempt to write to un-initialized area of memory.

Change-Id: I9881de71d58fa14db609fe3e24617a210b896471
Signed-off-by: Galanakis, Minos <[email protected]>
This patch changes the way data is put in the TX_DATA_PORT register when
sending packet over Ethernet.
When this driver is compiled with release compilation profile
(space optimization compiler options) with Arm compiler version 5,
the line:
SMSC9220->TX_DATA_PORT = *pktptr;
generates the assembly instruction to get the pktptr pointed value:
LDM r2!, {r3}
with pktptr = r2
However, the code does not prevent the pktptr value from being unaligned
(to a 32 bits boundary) in that zone and the LDM instruction causes a
HardFault if this is the case. When the compiler option is not activated
(debug and develop compilation profiles), the compiler generates LDR
instruction instead which does not cause a HardFault.
The ARM v7-M states page B3-601: "Unaligned load-store multiples and
word or halfword exclusive accesses always fault."

To face that problem, we check if the data pointer is aligned or not. If
it is, we apply the same algorithm than before. If not, a local variable
is created and we copy in it, byte per byte, the contents at the
unaligned pointer. However, it will impact performances adding 8
instructions (one LD and one ST for each copied byte).

Change-Id: I11f6e82ce5521960d2ecf499f718f76fec29c0b0
Signed-off-by: Hugues de Valon <[email protected]>
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 26, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Feb 26, 2018

Build : SUCCESS

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

Triggering tests

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

Copy link
Contributor

@jamesbeyond jamesbeyond left a comment

Choose a reason for hiding this comment

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

This fixed to CM3DS bugs fixes looks good.
But I just wonder the other platforms are using the same MPS2 board will not be fixed? Especially the ETH driver in targets\TARGET_ARM_SSG\TARGET_MPS2\SDK\ETH_MPS2.c

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 26, 2018

/morph uvisor-test

@hug-dev
Copy link
Contributor Author

hug-dev commented Feb 26, 2018

@jamesbeyond This PR now focuses only to CM3DS but when we do maintenance release on the other targets we support, we will make sure to include this fix as well.

@mbed-ci
Copy link

mbed-ci commented Feb 26, 2018

@mbed-ci
Copy link

mbed-ci commented Feb 26, 2018

@cmonr
Copy link
Contributor

cmonr commented Feb 27, 2018

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Feb 27, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 27, 2018

/morph export-build

@mbed-ci
Copy link

mbed-ci commented Feb 27, 2018

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