Skip to content

frdm_k64f: samples/net/sockets/echo_server doesn't work #13251

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

Closed
ghost opened this issue Feb 11, 2019 · 22 comments
Closed

frdm_k64f: samples/net/sockets/echo_server doesn't work #13251

ghost opened this issue Feb 11, 2019 · 22 comments
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP

Comments

@ghost
Copy link

ghost commented Feb 11, 2019

Unfixed part of the issue starts at #13251 (comment)

Below is fixed, don't look.


echo_server project compiles but crashes on frdm_k64f

  1. cmake -GNinja -DBOARD=frdm_k64f ..
  2. ninja flash

console output is:

***** Spurious interupt (IRQ  *****
***** Hardware exception *****
Cuent thread ID = 0x20001cb0
Fault instruction address = 0x2000aff0
Fatal fault in ISR! Spinning...

maybe this is related to #13243 ?

@ghost ghost added the bug The issue is a bug, or the PR is fixing a bug label Feb 11, 2019
@tbursztyka
Copy link
Collaborator

tbursztyka commented Feb 11, 2019

FIXED

and PR #13250 seems to fix it

@ghost
Copy link
Author

ghost commented Feb 11, 2019

FIXED

unfortunately PR #13250 does not fix it, but changes to error to:

***** BUS FAULT *****
  Imprecise data bus error
***** Hardware exception *****
Current thread ID = 0x20002bd0
Faulting instruction address = 0x17b08
Fatal fault in ISR! Spinning...

@pfalcon pfalcon changed the title samples/net/sockets/echo_server no longer working on frdm_k64f frdm_k64f: Networking samples are broken Feb 11, 2019
@pfalcon
Copy link
Collaborator

pfalcon commented Feb 11, 2019

FIXED

Confirmed, also tried samples/net/dns_resolve just to be sure that's not a particular sample, with the same output (crash addresses differ of course).

@pfalcon
Copy link
Collaborator

pfalcon commented Feb 11, 2019

FIXED

Confirming that #13250 seems to fix the issue for me.

@pfalcon
Copy link
Collaborator

pfalcon commented Feb 11, 2019

FIXED
However, ping doesn't work for me after that, so something is still not right.

@pfalcon
Copy link
Collaborator

pfalcon commented Feb 11, 2019

FIXED
Pings work after retry.

@ghost
Copy link
Author

ghost commented Feb 11, 2019

FIXED
ping and UDP echo works with #13250 if CONFIG_NET_TCP is disabled

@pfalcon do you have CONFIG_NET_TCP disabled?

@agansari
Copy link
Collaborator

agansari commented Feb 11, 2019

FIXED

Pings work after retry.

With #13260 and #13250 both patches.

@pfalcon
Copy link
Collaborator

pfalcon commented Feb 11, 2019

FIXED

@pfalcon do you have CONFIG_NET_TCP disabled?

Nope, I try to use pristine samples whenever possible (first I had some WIP code in my tree, and that could explain the issues I initially saw). I used samples/net/sockets/echo

@chtavares
Copy link

chtavares commented Feb 11, 2019

FIXED
My application is a coap-client, and when I start the image on the board, the same error occurs.

***** Spurious interrupt (IRQ  83) *****g to the first image slot
***** Hardware exception *****
Current thread ID = 0x20001f28
Faulting instruction address = 0x20007e08
Fatal fault in ISR! Spinning..

@ghost
Copy link
Author

ghost commented Feb 11, 2019

I used samples/net/sockets/echo_server, that only works if CONFIG_NET_TCP disabled.
A short test with samples/net/sockets/echo and #13250 works fine.

@pfalcon
Copy link
Collaborator

pfalcon commented Feb 11, 2019

@i8080, @chtavares592: Please retry with the latest master of d6a19af . If some issue still persists, please provided the exact revision used and steps to reproduce (sorry for asking to do that all over again), but tracing those steps thru multiple comments is errorprone.

@chtavares
Copy link

@pfalcon it worked for me!!

@ghost
Copy link
Author

ghost commented Feb 11, 2019

samples/net/sockets/echo_server only works if CONFIG_NET_TCP is disabled

how to reproduce:

  1. set CONFIG_NET_TCP=n in prj.conf

  2. cmake -DBOARD=frdm_k64f

  3. ninja flash

  4. ping and udp echo are working fine

  5. set CONFIG_NET_TCP=y in prj.conf (this is the default value)

  6. ninja flash

  7. no reaction on the board

  • OS: Ubuntu Linux 18.04
  • Toolchain Zephyr SDK 0.9.5
  • tested with latest master of d6a19af

@pfalcon pfalcon changed the title frdm_k64f: Networking samples are broken frdm_k64f: samples/net/sockets/echo_server doesn't work Feb 11, 2019
@pfalcon
Copy link
Collaborator

pfalcon commented Feb 11, 2019

7. no reaction on the board

Following steps described by @i8080, I can reproduce this. There's indeed absolutely zero output on UART from the board after pressing reset button. Ethernet connection is also not active.

By making following change to samples/net/sockets/echo_server/prj.conf, I can get serial output:

-CONFIG_MAIN_STACK_SIZE=2048
+CONFIG_MAIN_STACK_SIZE=4096

However, networking doesn't really. Apparently this was the case I was hitting when I reported "ping don't work" above.

By making following change:

-CONFIG_NET_SHELL=y
+#CONFIG_NET_SHELL=y

I get networking (pings, TCP conn) to work.

Assigning @rlubos as the maintainer of this sample.

Pinging @jarz-nordic regarding shell surprises.

Pinging @agansari regarding a hunch that IIRC we kinda had a conflict of UART and Ethernet on imxrt1050, could it occur here on frdm_k64f?

@jakub-uC
Copy link
Collaborator

jakub-uC commented Feb 11, 2019

@pfalcon : In my opinion it is not related to shell. I observed the same error today in example:
~/zephyr/zephyr/samples/net/vlan on frdm_k64f.

I have disabled shell in the same way as you did in prj.conf and this error was still there. When I disabled shell AND logger error was gone.
@nordic-krch : has investigated that. Error occured AFTER logger intialization and before first logged message. In our opinion it is some kind of a stack problem.

@pfalcon
Copy link
Collaborator

pfalcon commented Feb 11, 2019

When I disabled shell AND logger error was gone.

Thanks for that info. Well, logger remains the first suspect for me. Only today I disabled (or switched to IMMEDIATE) on multiple occasions, but today it didn't make a difference, and here I randomly flipped shell (based on knowing that socket/echo differs from socket/echo_server exactly by shell being enabled in the latter), and it clicked.

@nordic-krch
Copy link
Collaborator

***** Spurious interrupt (IRQ 83) ***** could that message be of any help? what is IRQ 83 on that platform.

I briefly tried to debugnet/vlan sample yesterday. Change to LOG_IMMEDIATE and had breakpoint on first log message but system was crashing earlier (but after log_core initialization) so even though logger is a suspect it has alibi for now.

@pfalcon
Copy link
Collaborator

pfalcon commented Feb 12, 2019

***** Spurious interrupt (IRQ 83) ***** could that message be of any help? what is IRQ 83 on that platform.

@nordic-krch, that issues was fixed. This ticket contains 2 unrelated issues reports. I was too shy to ask @i8080 to close this and submit a new one, and it pays off...

Please look at stuff only in and after this comment:
#13251 (comment)

@jakub-uC
Copy link
Collaborator

jakub-uC commented Feb 12, 2019

Today I've tested: ~/zephyr/zephyr/samples/net/sockets/echo_server
I have following observation:

  1. When I'm generating project with a cmake there is following error:

FATAL ERROR: unknown key "posixpath" in format string "{posixpath}".

Despite that project is created and can be build.

  1. When I remove either Logger or Shell I do not see interrupt spin error. When both are in prj.conf there is an error:
***** BUS FAULT *****
  Imprecise data bus error
***** Hardware exception *****
Current thread ID = 0x20002bd0
Faulting instruction address = 0x17b08
Fatal fault in ISR! Spinning...
  1. This will be good one! :)
    When I changed
    CONFIG_INIT_STACKS=y
    to
    #CONFIG_INIT_STACKS=y

Example works pefectly with shell AND Logger enabled.

@jakub-uC
Copy link
Collaborator

jakub-uC commented Feb 12, 2019

Another observation:
I keept all the features as they were AND I've addded one more:
CONFIG_LOG_PRINTK=y and it solved the problem.

We might have a problem with simultanous access to UART. @nordic-krch suggested that: Logger - shell
and printk are compeating for UART access at the same time. Maybe one is breaking anothers transfer?
When I've set CONFIG_LOG_PRINTK=y all parties accessing UART are synchronized.

@ghost
Copy link
Author

ghost commented Feb 12, 2019

@jarz-nordic @pfalcon

just opened new issue #13301 and closed this

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP
Projects
None yet
Development

No branches or pull requests

8 participants