For those of you with a LoRaONE, I have a Boards Manager configuration for testing.
It is the pre-release of our v1.6.7 SodaqCore-samd. It has support for SODAQ LoRaONE.
If you want to try it you can set this URL in your preferences.txt
I took a quick peek, it seems to have updated files and to provide for the proper pinout of the LoraOne pretty much as I did already myself. It doesn’t provide for the mods I made for Wire.cpp and SERCOM.cpp, but you can do these easily yourself. I will put some instructions together this evening and share these with you.
Here it is – to read bytes available from the uBlox …
// Arduino15/packages/SODAQ/hardware/samd/1.6.6/cores/arduino/SERCOM.cpp
// in function -- bool SERCOM::startTransmissionWIRE(uint8_t address, SercomWireReadWriteFlag flag)
// Ignore debug statements
484c485,487
< while ( !isBusIdleWIRE() );
// SerialUSB.print("Bus = ");
// SerialUSB.println(sercom->I2CM.STATUS.bit.BUSSTATE,HEX);;
while (!isBusIdleWIRE() && sercom->I2CM.STATUS.bit.BUSSTATE != 2); // WIRE_IDLE_STATE or WIRE_OWNER_STATE Bus idle or ‘we’ are the owner
// Arduino15/packages/SODAQ/hardware/samd/1.6.6/libraries/Wire/Wire.cpp
// in function -- uint8_t TwoWire::endTransmission(bool stopBit)
// stopBit has no function, add conditional logic to make it work
130a131,132
> if (stopBit)
> {
131a134,135
> }
Increased the buffer size in Ringbuffer.h (used by Wire.cpp) #define SERIAL_BUFFER_SIZE 256
Use below to read bytes available ….
Wire.beginTransmission(0x42);
i = Wire.write((uint8_t)0xfd); // Set register
i = Wire.endTransmission(false); // No stopbit as per manual DDC ublox (i.e. do not release the bus)
i = Wire.requestFrom(0x42, 2);//
uint16_t bytes = Wire.read() << 8;
bytes |= Wire.read();
Use below to read blocks from 128 bytes or more (depending on your serial_buffer size)
Wire.requestFrom(0x42, 128);
Hi Kees, I’m quiet familiar with GIT - Let me know where the sources are I need to pull in order for you to merge back …
BTW What did you change to variant.cpp when I diff I only see textual changes.
We have SodaqCore-samd at github, but that won’t have the LoRaONE yet. We have our own GIT server, but that is not publicly accessible. Unless … Can you PM me and I’ll give you access.
commit a2949d505f977ab267ce28c4b02ad17a4088a4e1
Author: Sandeep Mistry <s.mistry@arduino.cc>
Date: Wed Nov 18 09:19:04 2015 -0500
Wait for idle or bus owner state in startTransmissionWIRE instead of storing repeated start state.
This time I restarted the SodaqCore-samd based on ArduinoCore-samd v1.6.5. That means there are a lot of changes compared to our v1.6.6. Our own changes will be listed in the CHANGELOG soon, but I’ll add them here.
Add ARDUINO_SAMD_VARIANT_COMPLIANCE 10603
Added PWM to the RGB pins.
Fixed Serial. Description required SERCOM_ALT.
Fixed a spelling mistake for SWITCH_SENSE.
Correction include guard of sodaq_wdt/variant.h
There was a one off in the middle of g_APinDescription
Rename board id for LoRaONE in boards.txt
Increase SERIAL_BUFFER_SIZE to 129
Renamed the openocd_scripts cfg file.
Initial attempt at a pin mapping for the LoRaONE
Add new board variant for WDT
Correct chipname in debug script
Add new variants “serial3” and “serial23”
Add shell script to generate the distribution tar.bz2
Add board variant with Serial2
Undo the change in platform.txt for 1.6.6
Add pins for SD_DFLASH and CS_SD to match the names on Autonomo rev4
Avoid using void* in an arithmetic expression (in USBDeviceClass::send)
Changed hardcoded A0 for DAC in analogWrite()
Adding initialisation of TC6 & TC7
Added the same clock divider rule as the G18
Remove USB_HOST_ENABLE, we don’t have the hardware to output USB power
Make prototype of Serial_::begin consistent with implementation
Have a look at the new Boards Manager, there should now be one called “SODAQ Autonomo with SPI1” which connects to D5…D8.
Not a perfect solution (you need to connect three Groves, I think), but at least the possibility is there.