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

Lora Upgrade Issue - prints "p" then locks up #5

Open
tonygilkerson opened this issue Aug 21, 2023 · 3 comments
Open

Lora Upgrade Issue - prints "p" then locks up #5

tonygilkerson opened this issue Aug 21, 2023 · 3 comments

Comments

@tonygilkerson
Copy link
Owner

I am working with Lora sx127x on a Pico, when I upgraded to v0.28.0 things started to work. But today after I upgraded to v0.28.1 I am no longer able to Tx or Rx. It will find the radio but as soon as I start to Tx or Rx it prints p and locks up (i assume it is printing panic but does not get that far. The 10 second Rx loop work as long as it does not receive any data, but as soon as I send data with another device it locks up.

Patricio Whittingslow

See this slack thread

Patricio Whittingslow
2 months ago
So I tested my SX1278 and found d01d859 did indeed introduce the breaking change. 😔

$ git bisect good
d01d85930d19a73010853b7ba8648d8811891bee is the first bad commit
commit d01d85930d19a73010853b7ba8648d8811891bee
Author: soypat <[email protected]>
Date:   Sun Jun 11 15:03:45 2023 -0300

    rp2040: add spi busy waits on read and read/write transactions

 src/machine/machine_rp2040_spi.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Code

The addition of this code seems to cause the issue:
Source file /Users/tgilkerson/github/tinygo-org/tinygo/src/machine/machine_rp2040_spi.go

	for spi.isBusy() {
		gosched()
	}

Solution

See if you can run TinyGo from the dev branch and remove this lines until the upstream is fix

To run from dev I think I would do something like this:

  • Uninstall the TinyGo extention
  • Uninstall TinyGo with brew
  • Make change on the dev branch and do go install
  • Might have to crate a ln -s to have the TinyGo bin show up in the right place but I am not sure
@tonygilkerson
Copy link
Owner Author

@tonygilkerson
Copy link
Owner Author

tonygilkerson commented Aug 22, 2023

Workaround

I remove the "bad" code on the Tinygo dev branch:

  • Uninstalled the tinygo vscode extension
  • Uninstalled tinygo via brew
  • clone the tinygo-org/tinygo repo, checkout dev
  • then go install
  • I am not sure if this was needed but I created
ln -s /Users/tgilkerson/go/bin/tinygo /usr/local/bin/tinygo
  • then reinstalled the tinygo vscode extension

@tonygilkerson
Copy link
Owner Author

Workaround Take II

  • Install TinyGo the official way with brew
  • Get everything working in vscode
    • Install the TinyGo plugin
    • Make sure the TinyGo target is set and machine is recognized in the IDE
  • Modify the file as described below
# Make sure you have `pico` selected as the TinyGo target
# and the vscode is working then run the following
code  $(jq -r  '.["go.toolsEnvVars"].GOROOT' .vscode/settings.json)/src/machine/machine_rp2040_spi.go 

# Comment out the two occurrences of the following and save
	for spi.isBusy() {
		gosched()
	}

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

No branches or pull requests

1 participant