-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
USB error after upload sketch #273
Comments
W00ps, wrong button. This might happen when an assert happens with interrupts disabled. Assertion failures lock up in an infinite loop, and if interrupts are disabled, USB can no longer function. You could try re-enabling interrupts in the assertion handler to see if that helps (I don't have an example ready just now, let me know whether you can find this in the code). |
EDIT: But still, out of my league... tried figuring this out. |
Got a bit more time, now, sorry to plunge you into the deep before. The assert.h you mention is unrelated, LMIC implements its own assert. The problem is in the For now, try removing this line: Line 280 in 54bc51d
|
It didn't help. Still same problem: com port not available and a USB error stating the device isn't been recognised. |
Then maybe interrupts are already enabled when the assert fails. Try putting |
No error now. |
If this removed the USB errors, then an assert is indeed triggered. I suspect you're running into the following problem, which is native USB boards do not reset when the serial port is opened, so by the time you open up the serial port, startup is complete and the error message is already gone. Try adding |
20:39:53.013 -> FAILURE At least there is output :-) |
at that eroor is an ASSERT.
|
Yup, so I think that means a "interrupt" line is triggered without an interrupt pending in the chip. I would suspect a problem in your pinout or wiring of the DIO pins. |
hmmm.... Pins: VIN and GND both of them are connected to an external power (ARDUINO) The code I'm using is this:
Not sure what I did wrong. I'll rollback the code changes we did earlier. |
Note sure what pin G0 is, is that DIO0? My docs for the RFM95 have no Gx pins? Assuming G0 is DIO0, you configured just DIO0, but specified DIO0, DIO1 and DIO2 here:
If you leave out any, you should specify |
module I'm using: Link |
In the Hal.cpp file it states that the DIO0 AND DIO1 are required for LoRa... |
the G0 is an IRQ pin |
Looks like Gx refer to DIOx indeed (just submitted a suggestion to Adafruit to document this).
Yup, so you need to connect at least DIO0/G0 and DIO1/G1 and specify the other one as unused, e.g.:
However, I would still recommend also connection DIO2/G2, which is needed for FSK modulation, which can be used withing LoRaWAN as well (I think it is not used by default, but the network could send a command to start using it, I think). |
Did connect them al.... |
That's a different error, note the line number. What's on that line? |
#ifdef CFG_sx1276_radio |
the line ASSERT(v == 0x12); |
That means the version number read is not equal to what's expected. This likely means the SPI connection is bad. Doublecheck your connections, and maybe lower SPI speed here: Line 79 in 54bc51d
|
But SPI are just the SCK, MOSI and MISO pins.
What could he wrong there?
I'll try to lower the speed later of tomorrow.
Outlook for Android<https://aka.ms/ghei36> downloaden
…________________________________
From: Matthijs Kooijman <[email protected]>
Sent: Wednesday, March 18, 2020 9:30:41 PM
To: matthijskooijman/arduino-lmic <[email protected]>
Cc: Kuppens Stijn <[email protected]>; Author <[email protected]>
Subject: Re: [matthijskooijman/arduino-lmic] USB error after upload sketch (#273)
That means the version number read is not equal to what's expected. This likely means the SPI connection is bad. Doublecheck your connections, and maybe lower SPI speed here: https://github.com/matthijskooijman/arduino-lmic/blob/54bc51df00de18d7dd236fafac6b48e2597957f1/src/hal/hal.cpp#L79
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#273 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA6KDLW3XG6BPW5RQVIFU43RIEVPDANCNFSM4LOTZQ2Q>.
|
Might very well be the speed. It defaults to the max allowed for the radio, which is 10Mhz, but that's often too much for jumper wires. On 16Mhz AVR, this is less of a problem, since SPI is limited to 4Mhz IIRC, but your M0 board can probably actually do 10Mhz. |
10:56:51.213 -> FAILURE This was the adjustment: static const SPISettings settings(4E6, MSBFIRST, SPI_MODE0); |
Different error again, so that's progress. What's on line 660? |
This was the adjustment: static const SPISettings settings(4E6, MSBFIRST, SPI_MODE0); |
Hey Skuppens, Try using an older version of the library. I was running into a similar problem with my LoRa feather m0. And that solved my problem. Hope this helps! =] |
I'll give it a try as soon as I find me some tinkering time again. Thanks for the tip. I'll keep you posted. EDIT: Tried starting over again but didn't work. I am able to get to the serial output. No USB errors. I tried the previous versions but that didn't work either. Thank you |
Fix #268: these callbacks are now in client data
Hi,
Every time when i upload the sketch, The COM-port gets disconnected and I get a popup stating the USB-Device isn't functioning like it should.
I hooked it up according to your explanation, but somehow I don't get it to work.
I'm trying this with a Arduino Nano 33 IoT end an RFM95 module.
Feeding the module externally 3.3V, MISO, MOSI and SCK hooked up to same pins on Arduino side. RST on pin D5, CS (NSS) on Pin D6, G0 on Pin D2, ...
This is the pin mapping of the sketch:
const lmic_pinmap lmic_pins = {
.nss = 6,
.rxtx = LMIC_UNUSED_PIN,
.rst = 5,
.dio = {2, 3, 4},
};
Working with Arduino IDE ver.:1.8.12 and your lmic lora library for TTN connectivity.
Already thank you for looking in to this.
The text was updated successfully, but these errors were encountered: