by-passing the arduino-e-ness?

Development of new Cores using the STMCubeMX and HAL
User avatar
mrburnette
Posts: 1803
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: by-passing the arduino-e-ness?

Post by mrburnette » Thu Jan 21, 2016 2:33 pm

alextrezvy wrote:
mrburnette wrote:There is a reason that all commercial Pilots and Air Traffic Control all use English as the common denominator for communications... optimum word is common. The compilation in the ArduinoIDE of error free code is a common way to communicate with other makers and owners of compatible hardware. One does not have to "like" the environment, but the IDE does force some rules that help we forum members to assist and share.
As a consequence, we have to restrict ourself from using "non-common" features, such as USB, isn't it?
Of course not.
"compatible hardware" should probably have been written as "similar hardware" or maybe even "near-identical". The point is along the line of Nano to Nano clone, UNO to 328 Mini, Arduino Leonardo to Sparkfun's Micro, Maple/Maple-mini to clone STM32F103xx boards.

When I publish code that runs on a Maple Mini and I do that in Arduino, the IDE and tools environment is IMO simpler to install correctly for a novice; therefore the chances of a novice being able to successfully duplicate a project is enhanced.

Dropping down to the command line, while I'm comfortable with it, may not be appropriate as the best method of transferring a project from an author to a novice. Surely, there is no problem in communicating with those that are more knowledgeable and have experience with the lower-level approach to compilation and linking and uploading.

What you do with a consenting compiler and linker at the command line is between you and your adult computer. But as an author and adult trainer, I can assure you that a novice will perform better and will have greater success if the tools utilized hide as much complexity as possible. Nothing I have stated now or previously should even be read and internalized by the professional programmer as they are not included in my statement regarding the ArduinoIDE.

Even in this forum, I have seen often that seasoned programmers have issues replicating results obtained by others. Usually, it comes down to some environmental issue: version of tools, library flavors, installation paths, etc. Arduino IDE installation hides much of these issues on an OS to same OS nature. Here we have iOS, Windows, and several versions of Linux. If one has a correctly installed Arduino 1.6.5 environment, then we can discuss programming at a more abstract level without having to deal with the OS-centric and tool-centric issues.

IMO and respectfully: STM32duino.com should concentrate on using the ArduinoIDE environment. This opens the door to code use in 3 OS's as well as provide common denominator for sharing and testing. I do not think anyone here could care less about your personal PC or OS. Have a great, fancy script - then publish it here and describe the installation and OS and why your brainchild is brilliant. But, the topic of this thread is "by-passing the arduino-e-ness" and I find this not in alignment with STM32duino.

From a HAL software perspective, if the code can be utilized to drive the evolution/replacement of the existing core libraries and if this enhances the core - that is good. But all of these enhancements are under the hood of the ArduinoIDE and useful to everyone regardless of their expertise or their OS environment.


Ray

User avatar
mrburnette
Posts: 1803
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: by-passing the arduino-e-ness?

Post by mrburnette » Thu Jan 21, 2016 2:56 pm

zmemw16 wrote:@Ray
apologies for riling you.
my forum style can be a little (jovial, cynical, sarcastic, understated), i have a thought leapfrog issue and can be overly succinct.
actually i'm quite seriously dialled back in my postings as i once upset a Mexican and that really was quite interesting for a little bit. see above brackets :D

i'm aware to the topic and that i started it and your position in its regard, but whilst i appreciate it and do like its ease of use, the ability to drop down the abstraction level is to my mind not such a bad thing.
<...>
@zmemw16:

I'm not offended or annoyed.

I am however trying to inject into the conversational threads some consistency; that being that at the highest level, this forum was split from Arduino.cc not because the IDE was deficient (we all know that) but because the single-thread model of the Arduino.cc forum was being overwhelmed and becoming too large. Thanks be to Roger for stepping up and offering a migration to STM32duino.com

I love low-level stuff, do it all the time (more so when younger.) I love electronics which is my educational roots. This forum is diverse and many smart individuals drop by and provide tidbits of wisdom - all excellent. Like Arduino.cc we here are a cross-OS group: Windows, Linux, iOS and a scan of the forum will find many STM32 issues that are OS-centric .... some get addressed and corrected and some just get documented, for the moment. All good, but all different in the installation method, paths, and specific implementations. It is at this lower level that things breakdown, IMO.

Do we wish to have an STM32-iOS forum and an STM32-Linux forum and an STM32-x86 forum? We do a certain amount of this to provision the ArduinoIDE anyway. Do we want to fragment again and start having 3 lower-level implementations? I think this is not productive because at the ArduinoIDE level, we are all common and all benefit from code and projects and fixes. Examples and tricks and C/C++ knowledge work for all in the community. The compiles, the core libraries, and any specific 3rd party libraries are easy to leverage at the IDE level. Board definitions, compiler flags, linker options are all the same and differences for OS stuff is hidden away in the platform file.

Just my opinion,

Ray

zmemw16
Posts: 1422
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: by-passing the arduino-e-ness?

Post by zmemw16 » Thu Jan 21, 2016 8:14 pm

@ray
i like things being easy, overly so maybe.
to me arduino is about it being easy to use the hardware.

ok, maybe a thread title change, summarise :-
the visible abstraction layer is arduino [orientated/extendable?]
it's likely to have another layer of hardware abstraction - tdb,
but we'd like to tinker as well'
ultimately a stm32fx.

we're 'arduino on stm32fx, optional extras'?

however you can only blink so many leds, clatter relays, ... ... at some point a decision to do something more with it will occur or not, not is a loss.
i was reading/watching you-tube on esp-8266 with arduino and using AT commands, my thought was could i use a lua variant and what would it involve/what gains? probably not, but i looked just in case.

not hiding the hardware is also important, it makes it fun. at sometime people will have issues with it. if they don't see the hardware functionality and the connections, that'll lead to many more 'newbie' questions. encouraging people to take that extra look and google as you do, then ask slightly deeper questions will ultimately be more beneficial.

the stm32 aspect is that i like the go faster stripe, i don't want it to be my purchasing reason, but i want to get it at the right price, just below the knee of the performance and resources against cost graph, where it's still linear and not asymptotic.
my eyes only go so fast, my brain somewhat slower.

your projects are building blocks to me, i do the same, i tend to do it in software, i break the ultimate destination into little programs with just one aspect, debug those and assemble (shave , glue ) them into my picture frame.
if i can see a possible (future or multiple use) benefit to moving a chunk of my blocks to a sub-system, whether it's to an attiny85, atmega1284 or a stm32 chip. it's just a block.

i once had 2yrs commissioning an ate system, freedom to go anywhere from a command language, interpreter written in macro-11 through any of the sub-systems(8031/2,8051/52), adc, dac, controlled power supplies, relay card types and STT's, interfaces to ieee equipment to the inside of the target uut.
object find the reason it don't and where, suggest how to fix it. i got there really early and left really late. all immensely enjoyable.

stephen
currently massively distracted, frontier series, ryk brown, 11 down, 4 to go, - very tom clany'ish style, kindle unlimited

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: by-passing the arduino-e-ness?

Post by RogerClark » Thu Jan 21, 2016 8:34 pm

Am I missing something here.. But wouldn't the HAL functions be akin to a library ?

Albeit the library is not for external hardware, but its not uncommon to have a library e.g AVR TimerOne , which purely provides access to hardware functions that the core Arduino API doesnt.
(EEPROM library is the same)

But... I think in reality it would be impractical to write such a library to be compatible with Libmaole, as it would proably cause massive code bloat, and potentially cause the core to stop working when various HAL functions were run.
It would also duplicate a lot of functions in the Arduino API and the libmaple API.


I suspect the only practical way to do this is using @sheepdoll's HAL based core, rather than libmaple.

In terms of Arduino-ness.

I presume if a system has all the Arduino 1.0 API functions, and uses setup() and loop(), and handles libraries in an Arduino way ... and compiles in the Arduino IDE

Then it probably passes the test.

( cases in point, include the Teensy and ESP8266-Arduino)

zmemw16
Posts: 1422
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: by-passing the arduino-e-ness?

Post by zmemw16 » Thu Jan 21, 2016 9:00 pm

my muddled thinking. i was thinking the core was an abstraction layer.

would you have seen an outline structure/diagram of it anywhere? at this point even a terrible one :?
doxygen????

stephen

User avatar
mrburnette
Posts: 1803
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: by-passing the arduino-e-ness?

Post by mrburnette » Thu Jan 21, 2016 9:23 pm

RogerClark wrote: <...>
In terms of Arduino-ness.

I presume if a system has all the Arduino 1.0 API functions, and uses setup() and loop(), and handles libraries in an Arduino way ... and compiles in the Arduino IDE

Then it probably passes the test.

( cases in point, include the Teensy and ESP8266-Arduino)
Strongly agree..

Ray

zmemw16
Posts: 1422
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: by-passing the arduino-e-ness?

Post by zmemw16 » Thu Jan 21, 2016 9:27 pm

ditto

stephen

User avatar
mrburnette
Posts: 1803
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: by-passing the arduino-e-ness?

Post by mrburnette » Thu Jan 21, 2016 10:01 pm

zmemw16 wrote:my muddled thinking. i was thinking the core was an abstraction layer.

would you have seen an outline structure/diagram of it anywhere? at this point even a terrible one :?
doxygen????

stephen
Stephen,
Table 1 of this excellent article describes well what I think you want to see. In my mind, this is not an "abstraction" layer. My friend Coding Badly defines "core files" as:
... For the most part, it is a library that provides the Arduino functions (pinMode, digitalRead, digitalWrite).
Roger's statement:
I suspect the only practical way to do this is using @sheepdoll's HAL based core, rather than libmaple.
represents a way that one member is approaching a hybrid solution to the F4 in that she bypassing libmaple which is defined by the authors as:
... is the library we have developed for the STM32 line of ARM Cortex M3 microcontrollers. Its high-level interfaces are largely compatible with the AVR libraries written for the Arduino and Wiring development boards.
Libmaple provides a set of API calls.

Lastly, my old forum friend westfw answered when asked, "Should I consider the Arduino Language a Super Set of C/C++?"
No, it's just

An "abstraction" layer that simplifies various hardware concepts that C/C++ does not handle natively.

A set of libraries to implement that abstraction (and replace various posix libraries that aren't applicable on a microcontroller.)

A censored set of documentation that avoids mentioning any number of C/C++ concepts believed to be too confusing for beginners.
Definitions are muddy with uC and the definitions are more cleat with microprocessors used in old-style (non-SOC) PC's.

Ray

User avatar
RogerClark
Posts: 6917
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: by-passing the arduino-e-ness?

Post by RogerClark » Thu Jan 21, 2016 10:09 pm

In terms of libraries, I find it quite interesting what the ESP8266 team (guy) has done in making lots of the things that appear to be intrinsic to the ESP8266 (e.g. its WiFi'ness) into libraries

https://github.com/esp8266/Arduino/tree ... /libraries

I'm not sure if there is anything we could take from this approach, possibly not, but I still think its a well structured "Core"

User avatar
mrburnette
Posts: 1803
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: by-passing the arduino-e-ness?

Post by mrburnette » Thu Jan 21, 2016 10:23 pm

RogerClark wrote:In terms of libraries, I find it quite interesting what the ESP8266 team (guy) has done in making lots of the things that appear to be intrinsic to the ESP8266 (e.g. its WiFi'ness) into libraries
<...>
As I understand, this was specifically done so that:
WiFi(ESP8266WiFi library)
This is mostly similar to WiFi shield library.
Essentially, since the radio is a core peripheral, some of the radio functions are truly "core". For instance, SPIFFS is now core functionality.

The very cheap price of the ESP8266 is now driving me to investigate the device much more - with the RF section disabled!

Ray

Post Reply