Page 1 of 2

KontroLIR: Arduino IDE issues with Test Suite [SOLVED]

Posted: Sat Jan 11, 2020 1:28 am
by ShaunLovell
1) In my Arduino IDE (v 1.8.10), the Tools>Board menu does not offer a "ATmega328PB Crystal Clock" selection as instructed in the "Getting Started" wiki. I have installed the "Atmel AVR Xplained minis" core for the IDE, which gets me a "ATmega328pb-xplained mini" selection under the Tools>Board menu, but I still don't have any place to select the 4Mhz clock speed so I'm assuming this is still not the right board. This is the only core I could find with a board of any name similar to that one. Can you tell me where to obtain the correct core for the desired board?

2) The wiki says to load the folder into the IDE but this does not compute for me. The IDE loads an *.ino file and if that file does not have the same name as the folder in which it resides, the IDE offers to create a folder of that name and move the *.ino file into it. The folder, as downloaded & unzipped, does not contain an *.ino file of the same name. I renamed both the folder and the "KIR_V100TestSuite.ino" file to "KIR_TestSuite" and the IDE will now load the "KIR_TestSuite.ino" file and all of the other files. Is this the correct work-around or am I still missing something?

3) I get a compiler error complaining of a missing file:
-------------------------(snip)
Arduino: 1.8.10 (Windows 7), Board: "Atmel atmega328pb Xplained mini"
In file included from C:\Users\Shaun\Documents\Arduino\KontrolIR\KIR_TestSuite\KIR_TestSuite.ino:16:0:
KIR_header.h:25:10: error: extEEPROM.h: No such file or directory
#include "extEEPROM.h"
^~~~~~~~~~~~
compilation terminated.
exit status 1
extEEPROM.h: No such file or directory

(snip) _________________

Was this file left out of the batch or is it no longer required?

TIA
Shaun

Re: Arduino IDE issues with Test Suite

Posted: Sat Jan 11, 2020 12:43 pm
by AnalysIR
1) In my Arduino IDE (v 1.8.10), the Tools>Board menu does not offer a "ATmega328PB Crystal Clock" selection as instructed in the "Getting Started" wiki. I have installed the "Atmel AVR Xplained minis" core for the IDE, which gets me a "ATmega328pb-xplained mini" selection under the Tools>Board menu, but I still don't have any place to select the 4Mhz clock speed so I'm assuming this is still not the right board. This is the only core I could find with a board of any name similar to that one. Can you tell me where to obtain the correct core for the desired board?
I have updated the WiKi with instructions on configuring the IDE. Actually, it is already in another section of the WiKI, but I have now added it to the getting started section as well.

https://wiki.analysir.com/index.php?tit ... ng_Started

I will respond to your other points shortly.

Re: Arduino IDE issues with Test Suite

Posted: Sat Jan 11, 2020 12:49 pm
by AnalysIR
2) The wiki says to load the folder into the IDE but this does not compute for me. The IDE loads an *.ino file and if that file does not have the same name as the folder in which it resides, the IDE offers to create a folder of that name and move the *.ino file into it. The folder, as downloaded & unzipped, does not contain an *.ino file of the same name. I renamed both the folder and the "KIR_V100TestSuite.ino" file to "KIR_TestSuite" and the IDE will now load the "KIR_TestSuite.ino" file and all of the other files. Is this the correct work-around or am I still missing something?
Actually, rename both the folder an .ino to KIR_TestSuite_V106 & KIR_TestSuite_V106.ino respectively. We will be issuing a minor firmware update hopefully next week and will include these changes.

Re: Arduino IDE issues with Test Suite

Posted: Sat Jan 11, 2020 12:57 pm
by AnalysIR
3) I get a compiler error complaining of a missing file:
I have also added intructions to the WiKi about installing he extEEPROM library to the Arduino IDE.

Re: KontroLIR: Arduino IDE issues with Test Suite

Posted: Sat Jan 11, 2020 7:00 pm
by ShaunLovell
Thanks,

I get the board selection now, as well as clock speed selections, but 4Mhz is not one of them:
IDEBoards.jpg

I also get the following compiler error:
------------------------------------------------------------------
Arduino: 1.8.10 (Windows 7), Board: "ATmega328, Yes (UART1 328PB only), 328PB, BOD 2.7V, LTO disabled, 8 MHz external"

In file included from sketch\KIR_header.h:29:0,

from C:\Users\Shaun\Documents\Arduino\KontrolIR\KIR_TestSuite_V106\KIR_TestSuite_V106.ino:16:

KIR_Vars.h:134:23: error: invalid conversion from 'long unsigned int' to 'eeprom_size_t' [-fpermissive]

#define EESIZE EEBITS / 1024

^

C:\Users\Shaun\Documents\Arduino\KontrolIR\KIR_TestSuite_V106\KIR_TestSuite_V106.ino:20:20: note: in expansion of macro 'EESIZE'

extEEPROM myEEPROM(EESIZE, 1, EEPAGESIZE, addressEE);

^~~~~~

In file included from sketch\KIR_header.h:25:0,

from C:\Users\Shaun\Documents\Arduino\KontrolIR\KIR_TestSuite_V106\KIR_TestSuite_V106.ino:16:

C:\Users\Shaun\Documents\Arduino\libraries\extEEPROM/extEEPROM.h:83:9: note: initializing argument 1 of 'extEEPROM::extEEPROM(eeprom_size_t, byte, unsigned int, byte)'

extEEPROM(eeprom_size_t deviceCapacity, byte nDevice, unsigned int pageSize, byte eepromAddr = 0x50);

^~~~~~~~~

C:\Users\Shaun\Documents\Arduino\KontrolIR\KIR_TestSuite_V106\KIR_TestSuite_V106.ino: In function 'void setup()':

KIR_TestSuite_V106:60:44: error: invalid conversion from 'long unsigned int' to 'extEEPROM::twiClockFreq_t' [-fpermissive]

byte i2cStat = myEEPROM.begin(1000000UL);

^

In file included from sketch\KIR_header.h:25:0,

from C:\Users\Shaun\Documents\Arduino\KontrolIR\KIR_TestSuite_V106\KIR_TestSuite_V106.ino:16:

C:\Users\Shaun\Documents\Arduino\libraries\extEEPROM/extEEPROM.h:84:14: note: initializing argument 1 of 'byte extEEPROM::begin(extEEPROM::twiClockFreq_t)'

byte begin(twiClockFreq_t twiFreq = twiClock100kHz);

^~~~~

exit status 1
invalid conversion from 'long unsigned int' to 'eeprom_size_t' [-fpermissive]
-------------------------------------------------------

Re: KontroLIR: Arduino IDE issues with Test Suite

Posted: Sat Jan 11, 2020 8:43 pm
by AnalysIR
Hi Shaun

i am running 1.8.9 of the IDE and 2.0.3 of MCUdude's MiniCore.
Boards Manager:
BoardsManager.jpg
Tools Menu:
ToolsMenuArduino1.8.9.jpg

The first thing to try is to install the IDE & minicore as above.


I just noticed from the minicore github, that the features have been updated from what I have. Although the latest version seems to be v2.0.3. So I will install IDE v1.8.10 tomorrow and chase down this issue (late here now).

Re: KontroLIR: Arduino IDE issues with Test Suite

Posted: Sat Jan 11, 2020 9:44 pm
by ShaunLovell
That's very interesting. I dug through the files on Github and found this table in a filed called "avr/boards.txt":

AVRBoards.JPG
[/url]

Do you suppose this means I need to change the "upload speed" field to 19200 (wherever that is) to get the 4 Mhz option?

Did you install minicore manually? I used the "Additional Boards Manager URLs" function in IDE, and it is version 2.0.3.

On the bright side, this is what I see when I turn on the serial monitor at 115200 bps:
----------------------------------
KontroLIR - Test Suite v1.00
Clock Speed (Hz): 8000000
Mode: USB Powered
Lock Bits: 0xCF PASSED
Low Fuse: 0xFF PASSED
High Fuse: 0xDE PASSED
Extended Fuse: 0xF6 PASSED
Signature: 0x1E9516 PASSED
OSCCAL: 0x96
Serial: 0x5051304A424769161AF
EEPROM Size(bits): 128
EEPROM Page Size: 64
EEPROM Pages: 256
EEPROM Address: 0x50
I2C OK


Test Command Menu ===================
l - blink LED 5 times
b - Test All buttons
e - Test I2C EEPROM
r - Check IR Receivers
T - EEPROM T command
F - EEPROM F command (fill with 0xFF = erase)
W - EEPROM Write Test date to every page
P - Print all page in HEX
=====================================
------------------------------------------------------

Re: KontroLIR: Arduino IDE issues with Test Suite

Posted: Sun Jan 12, 2020 1:10 pm
by AnalysIR
MAJOR FACEPALM :roll:

I pointed to the wrong core in the docs...it should be the watterott one instead of the minicore.

So, just go ahead and use/install the ATmeag328PB core at: https://github.com/watterott/ATmega328PB-Testing

or you can just insert the following into the additional Boards Manager URLs in the IDE: https://github.com/watterott/ATmega328PB-Testing
https://github.com/watterott/ATmega328P ... index.json
(Note this may change in future, so if there are any issues double-check with the install instructions on the GitHub link above)

Big apologies for this mix-up and many thanks for your efforts in highlighting this.

I will also update the Wiki to reflect the above.


UPDATE: The WiKI has now been updated with the corrections.

Re: KontroLIR: Arduino IDE issues with Test Suite

Posted: Sun Jan 12, 2020 8:30 pm
by ShaunLovell
Post cancelled. See next post.



That got me the correct board selections. I think the "eeprom_size_t" compiler error went away (possibly with installing the "streaming" library that's required for extEEPROM). However, I'm on to a new compiler error relating to extEEPROM.cpp:
------------------------------------
Arduino: 1.8.10 (Windows 7), Board: "ATmega328PB Crystal Clock, 4 MHz"

C:\Users\Shaun\Documents\Arduino\libraries\extEEPROM\extEEPROM.cpp: In member function 'byte extEEPROM::begin(extEEPROM::twiClockFreq_t)':

C:\Users\Shaun\Documents\Arduino\libraries\extEEPROM\extEEPROM.cpp:98:5: error: 'TWBR' was not declared in this scope

TWBR = ( (F_CPU / twiFreq) - 16) / 2;

^~~~

C:\Users\Shaun\Documents\Arduino\libraries\extEEPROM\extEEPROM.cpp:98:5: note: suggested alternative: 'TWBR0'

TWBR = ( (F_CPU / twiFreq) - 16) / 2;

^~~~

TWBR0

---------------------------------------------------------------

Notice that it seems to suggest changing "TRWB" to "TWBRO". Trying this results in a "TWBRO not defined" error. A work-around suggested on the github page was:
---------------
#ifdef __AVR__
TWBR = ( (F_CPU / twiFreq) - 16) / 2;
#endif

----------------
but this just resulted in another "TWBR not defined" error.

Do you remember ever having to change anything in extEEPROM?

Re: KontroLIR: Arduino IDE issues with Test Suite

Posted: Sun Jan 12, 2020 8:52 pm
by ShaunLovell
Belay that request!

I managed to get a clean compile after deleting the streaming and extEEPROM libraries that I had installed manually, and re-installing them using the libraries manager in the IDE. My apologies for any confusion. It connects to the Serial monitor at 19200 now and I seem to be in business.

Thanks
Shaun