mcci-catena / Catena-Arduino-Platform

Arduino platform library for MCCI Catena IoT Systems
MIT License
12 stars 11 forks source link

Catena 4460 questions #172

Open trlafleur opened 5 years ago

trlafleur commented 5 years ago

1) I'm using a 4460, but need to add an I2C device at addr: 0x50 where the Fram is located... I see the FRAM8K driver and it has its address defined in the Mb85rc64ta.h file, so I can change it there, but for completeness, I do not see the same for the Fram2k. I can re-address the part on the board, but what do I need to change to select the FRAM64 device in the 4460 code base?

Just change the reference below in: CatenaWingFram2k? to cFram8k? is there a better way??

private:
    // the FRAM instance
    McciCatena::cFram2k         m_Fram;
        uint32_t                                m_BootCount;
    };

I would expect that all reference for a particular product device would be in a common .hal or .h file for the device... like device's info, clock rates, SPI information, vbat pin, vbat scaling, led pins, any other hardware related assignments. It's a bit confusing to make change the way it is now...

2) I noticed on start up, I see LoRaWAN Init: message, where is the ?CatenaBase::GetProvisioningStyle: infor comming from.

Catena 4460 sensor1 V0.1.1
LoRaWAN init: ?CatenaBase::GetProvisioningStyle: failing
?CatenaWingFram2k::LoRaWAN::begin: Arduino_LoRaWAN:begin failed
failed
CPU Unique ID: f2-06-ca-96-35-50-4d-51-20-20-20-35-37-1e-11-ff
**** no platform, check provisioning ****
No mods detected
vBat:    4299 mV
EV_JOINING
EV_TXSTART
EV_JOINED
NwkID:   00000013   DevAddr: 26022f77
EV_TXSTART

3) can the USB serial data be re-assigned to a standard UART on the device, like Serial1 4) Is there a list of operatingflags avilable? 5) is there a document that explaned the steps needed to add a new board to the stack?

thanks...

terrillmoore commented 5 years ago

Sorry, I've been busy on a project. My colleagues will try to help with some of this; otherwise I'll try to reply over the weekend.

trlafleur commented 5 years ago

Thanks....

On Fri, Jun 7, 2019 at 7:30 AM Terry Moore notifications@github.com wrote:

Sorry, I've been busy on a project. My colleagues will try to help with some of this; otherwise I'll try to reply over the weekend.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mcci-catena/Catena-Arduino-Platform/issues/172?email_source=notifications&email_token=ABC4EK3WPB7SIQNGJMEAQFDPZJWJTA5CNFSM4HTBEGQ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXF7XQA#issuecomment-499907520, or mute the thread https://github.com/notifications/unsubscribe-auth/ABC4EK4RIB7PJ3YLCPHTSALPZJWJTANCNFSM4HTBEGQQ .

--

~~ /) ~~~~ /) ~~ _/) ~~ _/) ~~

Tom Lafleur

dhineshkumarmcci commented 5 years ago

Hi @trlafleur, Please find our answers inline in this comment.

We are working on your other question on FRAM. We will get back to you soon with the answer.

Best Regards, Dhinesh

terrillmoore commented 5 years ago

The 2k FRAM support comes from a separate library, which we forked from adafruit: https://github.com/mcci-catena/Adafruit_FRAM_I2C. The address is set in the begin() routine, Adafruit_FRAM_I2C::begin(); if the input address is 0, the hardware default is used.

So you have to change: https://github.com/mcci-catena/Catena-Arduino-Platform/blob/553dd7f81c236699e91161d18b76a9bca5bb5a90/src/lib/Catena_Fram2k.cpp#L77-L79

to be:

        if (! this->Super::begin() ||
        ! this->m_hw.begin(MY_I2C_ADDRESS, &Wire))
        return false;

Define MY_I2C_ADDRESS to the address you're using on the board, and this should work.

terrillmoore commented 5 years ago

On the SAMD BSP, it is possible to use Serial1. See how I do it in the https://github.com/mcci-catena/Modbus-for-Arduino/blob/master/examples/catena_simple_host/catena_simple_host.ino. You will have to figure out how to substitute Serial1 for Serial as needed. Once you do that, things should work; we've tested the command framework on other boards that use HW serial. There may be software compatibility issues with Serial1 vs SerialUSB, namely the while (! Serial) idiom. On our STM32 BSP, we added a ! operator on the UartSerial ports (returning constant true). We can consider doing that for the SAMD as well, but that's a separate ticket.