Skip to content
This repository was archived by the owner on Apr 24, 2019. It is now read-only.

EMAC override to default i/f ethernet #405

Merged
merged 3 commits into from
Jun 6, 2018
Merged

Conversation

JanneKiiskila
Copy link
Contributor

UBLOX_EVK_ODIN_W2 over ethernet will not work as Mbed OS 5.9 changed
the way EMAC works. We have to use a different way to do the switch
to ethernet with that board with Mbed OS 5.9 and onwards.

UBLOX_EVK_ODIN_W2 over ethernet will not work as Mbed OS 5.9 changed
the way EMAC works. We have to use a different way to do the switch
to ethernet with that board with Mbed OS 5.9 and onwards.
Copy link
Contributor

@SeppoTakalo SeppoTakalo left a comment

Choose a reason for hiding this comment

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

This is now correct for 5.9.

@JanneKiiskila
Copy link
Contributor Author

JanneKiiskila commented Jun 5, 2018

Odin WiFi is now failing, in compilation phase.

Link: mbed-os-example-client
Error: L6218E: Undefined symbol mbedtls_rsa_pkcs1_encrypt (referred from ./mbed-os/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/TOOLCHAIN_ARM/libublox-odin-w2-driver.ar(cb_tls.o)).
Error: L6218E: Undefined symbol mbedtls_rsa_pkcs1_sign (referred from ./mbed-

That's not related to this PR, that's now the hidden dependency they've added with Mbed OS 5.9.

Ref. Mbed OS PR #6963

@SeppoTakalo
Copy link
Contributor

This was already known and fixed in PAL: https://github.com/ARMmbed/mbed-client-pal/pull/490

@JanneKiiskila
Copy link
Contributor Author

Yes, unfortunately that fix does not work as-is here, since we are using a different PAL implementation. But, this should be trivial to fix.

@teetak01
Copy link
Contributor

teetak01 commented Jun 5, 2018

@SeppoTakalo
Copy link
Contributor

This is already legacy application so probably dropping those lines away from the TLS config is justified, it adds about 20 kB flash usage, but those example boards are not small.

UBLOX_EVK_ODIN_W2 needs the RSA with Mbed OS 5.9 onwards, there is
some internal dependency which failed the linking (due to Client
optimizing the RSA out).

Ref. Mbed OS PR #6963
@JanneKiiskila
Copy link
Contributor Author

One more commit, similar fix as in mbed-client-pal (but only slightly similar, as there is no mbed_lib.json in pal). That should fix it.

Copy link
Contributor

@teetak01 teetak01 left a comment

Choose a reason for hiding this comment

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

Ublox + WIFI + IAR causes hardfault:

14:57:21.199 | D1 <<< DutThread: ++ MbedOS Fault Handler ++
14:57:21.200 | D1 <<< DutThread: FaultType: HardFault
14:57:21.200 | D1 <<< DutThread: Context:
14:57:21.200 | D1 <<< DutThread: R0 : FFFFFFFF
14:57:21.201 | D1 <<< DutThread: R1 : 2002A33C
14:57:21.201 | D1 <<< DutThread: R2 : 00000000
14:57:21.202 | D1 <<< DutThread: R3 : 080E844C
14:57:21.203 | D1 <<< DutThread: R4 : 00000000
14:57:21.203 | D1 <<< DutThread: R5 : 080D0599
14:57:21.203 | D1 <<< DutThread: R6 : 00000000
14:57:21.204 | D1 <<< DutThread: R7 : 00000004
14:57:21.204 | D1 <<< DutThread: R8 : 00000000
14:57:21.204 | D1 <<< DutThread: R9 : 20008860
14:57:21.205 | D1 <<< DutThread: R10 : 00000000
14:57:21.205 | D1 <<< DutThread: R11 : 00000000
14:57:21.205 | D1 <<< DutThread: R12 : 080BFCA1
14:57:21.206 | D1 <<< DutThread: SP : 2000BEA0
14:57:21.206 | D1 <<< DutThread: LR : 080B6C1D
14:57:21.206 | D1 <<< DutThread: PC : 080D05A4
14:57:21.206 | D1 <<< DutThread: xPSR : 61000000
14:57:21.207 | D1 <<< DutThread: PSP : 2000BE80
14:57:21.207 | D1 <<< DutThread: MSP : 20006DE8
14:57:21.207 | D1 <<< DutThread: CPUID: 410FC241
14:57:21.207 | D1 <<< DutThread: HFSR : 80000000
14:57:21.207 | D1 <<< DutThread: MMFSR: 00000000
14:57:21.208 | D1 <<< DutThread: BFSR : 00000000
14:57:21.208 | D1 <<< DutThread: UFSR : 00000000
14:57:21.208 | D1 <<< DutThread: DFSR : 0000000A
14:57:21.208 | D1 <<< DutThread: AFSR : 00000000
14:57:21.209 | D1 <<< DutThread: SHCSR: 00000000
14:57:21.209 | D1 <<< DutThread: Mode : Thread
14:57:21.210 | D1 <<< DutThread: Priv : Privileged
14:57:21.210 | D1 <<< DutThread: Stack: PSP
14:57:21.210 | D1 <<< DutThread: Threads Info:
14:57:21.210 | D1 <<< DutThread: Current:
14:57:21.211 | D1 <<< DutThread: State: 0x00000002 Entry: 0x080BCD41 Stack Size: 0x00001000 Mem: 0x2000AF48 SP: 0x2000BED8
14:57:21.211 | D1 <<< DutThread: Next:
14:57:21.212 | D1 <<< DutThread: State: 0x00000002 Entry: 0x080BCD41 Stack Size: 0x00001000 Mem: 0x2000AF48 SP: 0x2000BED8
14:57:21.212 | D1 <<< DutThread: Wait:
14:57:21.212 | D1 <<< DutThread: State: 0x00000083 Entry: 0x08130139 Stack Size: 0x00000300 Mem: 0x20026BF0 SP: 0x20026E88
14:57:21.213 | D1 <<< DutThread: Delay:
14:57:21.303 | D1 <<< DutThread: State: 0x00000043 Entry: 0x080BCD41 Stack Size: 0x00000200 Mem: 0x200082A8 SP: 0x20008410
14:57:21.303 | D1 <<< DutThread: Idle:
14:57:21.304 | D1 <<< DutThread: State: 0x00000001 Entry: 0x080C20C1 Stack Size: 0x00000200 Mem: 0x20027C80 SP: 0x20027E30
14:57:21.304 | D1 <<< DutThread: -- MbedOS Fault Handler --
14:57:21.304 | D1 <<< DutThread: ++ MbedOS Error Info ++
14:57:21.304 | D1 <<< DutThread: Error Status: 0x80ff013d Code: 317 Entity: 255
14:57:21.305 | D1 <<< DutThread: Error Message: System encountered an unrecoverable fault excaption, halting system.
14:57:21.305 | D1 <<< DutThread: Location: 0x80d05a4

@JanneKiiskila
Copy link
Contributor Author

Oh darn. I would list it as a known issue. Wonder if the increased memory consumption is now causing some issues, out of stack or heap?

@JanneKiiskila
Copy link
Contributor Author

JanneKiiskila commented Jun 5, 2018

Compilation job output.

Link: mbed-os-example-client
Elf2Bin: mbed-os-example-client
+------------------------------------+---------+-------+-------+
| Module                             |   .text | .data |  .bss |
+------------------------------------+---------+-------+-------+
| [lib]/dl7M_tlf.a                   |   19140 |   620 |   716 |
| [lib]/dlpp7M_tl_fc.a               |     186 |     0 |     0 |
| [lib]/libublox-odin-w2-driver.a    |  936935 |   780 | 12809 |
| [lib]/m7M_tls.a                    |    3882 |     0 |     0 |
| [lib]/rt7M_tl.a                    |    1520 |     0 |     0 |
| [misc]                             |     874 |     0 |     0 |
| easy-connect/easy-connect.o        |     828 |     0 |   872 |
| easy-connect/wifi-x-nucleo-idw01m1 |      68 |     0 |    68 |
| easy-connect/wnc14a2a-driver       |     426 |   480 |     0 |
| main.o                             |    8989 |    18 |   280 |
| mbed-client/mbed-client-c          |    5114 |    42 |     0 |
| mbed-client/mbed-client-classic    |    3452 |    24 |    76 |
| mbed-client/mbed-client-mbed-tls   |    1392 |     0 |    21 |
| mbed-client/source                 |   29416 |     0 |     8 |
| mbed-os/drivers                    |     928 |     0 |     0 |
| mbed-os/events                     |    1826 |     0 |  1685 |
| mbed-os/features                   |  139003 |   502 | 53769 |
| mbed-os/hal                        |    1478 |     4 |    66 |
| mbed-os/platform                   |    2318 |   144 |   113 |
| mbed-os/rtos                       |   16526 |   168 |  6465 |
| mbed-os/targets                    |   19138 |    16 |  1213 |
| pal/Source                         |    2912 |    72 |   956 |
| Subtotals                          | 1196351 |  2870 | 79117 |
+------------------------------------+---------+-------+-------+
Total Static RAM memory (data + bss): 81987 bytes
Total Flash memory (text + data): 1199221 bytes

Image: ./BUILD/UBLOX_EVK_ODIN_W2/IAR/mbed-os-example-client.bin

Problem doesn't seem to be (on a quick glance) the size, as it's smaller than GCC binary (both RAM and ROM).

@SeppoTakalo
Copy link
Contributor

@teetak01 Please create Jira ticket to ONME project, we have already one hard fault on Ublox, so this might be related.

@SeppoTakalo
Copy link
Contributor

CC: @KariHaapalehto is this the same IAR crash?

@teetak01
Copy link
Contributor

teetak01 commented Jun 6, 2018

ONME-3692

Add link to the Mbed OS case for UBLOX_EVK_ODIN_W2 & IAR crash.
Copy link
Contributor

@ashok-rao ashok-rao left a comment

Choose a reason for hiding this comment

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

Code changes look fine to me @JanneKiiskila .. what about the hard fault with IAR + 5.9? Will it be fixed in time or add to known issues?
cc @adbridge @MarceloSalazar

@JanneKiiskila
Copy link
Contributor Author

@ashok-rao - there's an accompanying commit for the README.md which lists this issue. I of course hope it gets fixed - then we'll remove that note. But, let's see - these are not always that trivial to fix.

@JanneKiiskila JanneKiiskila merged commit 515147b into mbed-os-5.9.0-oob Jun 6, 2018
@JanneKiiskila JanneKiiskila deleted the odin_eth_fix branch June 6, 2018 13:16
@ashok-rao
Copy link
Contributor

@adbridge : could we add this to the known issues list please. Thanks!

@adbridge
Copy link
Collaborator

adbridge commented Jun 7, 2018

@ashok-rao Known issues that are example based are listed in the example README, which from what @JanneKiiskila has said is already there (unless it is fixed before release).

@teetak01
Copy link
Contributor

teetak01 commented Jun 8, 2018

@adbridge @ashok-rao I am quite sure this is Mbed OS regression, which happens to appear as part of this example. It should be listed as Mbed OS regression also.

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

Successfully merging this pull request may close these issues.

5 participants