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

LT 1.5.0 crashes with "RTL8195A Hard Fault Error" after WiFi scan #257

Closed
hn opened this issue Feb 25, 2024 · 4 comments · Fixed by #258
Closed

LT 1.5.0 crashes with "RTL8195A Hard Fault Error" after WiFi scan #257

hn opened this issue Feb 25, 2024 · 4 comments · Fixed by #258
Labels
bug Something isn't working RTL8710B Realtek RTL87xxB family

Comments

@hn
Copy link
Contributor

hn commented Feb 25, 2024

LT 1.5.0 crashes on EMW3080 (RTL8710BN clone) as reported here: hn/ginlong-solis#22

LT 1.4.1 works fine on this MCU.

The crash is caused by 1d80b5f from #226 (checked by adding (cherry-picking) only this patch to 1.4.1 -> MCU crashes).

@hn hn changed the title Crash "RTL8195A Hard Fault Error" with LT 1.5.0 LT 1.5.0 crashes with "RTL8195A Hard Fault Error" after WiFi scan Feb 25, 2024
@kuba2k2 kuba2k2 added bug Something isn't working RTL8710B Realtek RTL87xxB family labels Feb 25, 2024
@kuba2k2
Copy link
Member

kuba2k2 commented Feb 25, 2024

@szupi-ipuzs
Something broke, I think. I will try to find the source of the issue.

@kuba2k2
Copy link
Member

kuba2k2 commented Feb 26, 2024

Here is the modified Realtek WiFi code. It seems that scanAlloc() returns the amount of allocated items, then the Realtek code tries to assign to the last item. The index in [] is wrong though, it tries to assign to one item past the last one.

Can you try adding last--; right after the if() that checks if the allocation succeeded? That should fix the issue.

@hn
Copy link
Contributor Author

hn commented Feb 26, 2024

rtl87xx:
  board: generic-rtl8710bx-4mb-980k
  framework:
    version: 0.0.0
    source: https://github.com/hn/libretiny#fix-257-wifi-scan

Et voilà ... it works :) MCU boots flawlessly with Version: v1.5.0+sha.72d46c9 on generic-rtl8710bx-4mb-980k

@kuba2k2
Copy link
Member

kuba2k2 commented Feb 26, 2024

PRs are welcome :)

Also, since you're using the generic BX version in your project, we can add that EMW board natively to LibreTiny. It could even have its own flash layout and pinout drawing to best match that board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working RTL8710B Realtek RTL87xxB family
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants