ConBasic- Hello World

Questions about the BASICtools and MakeItC
olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

ConBasic- Hello World

Post by olzeke51 »

Was playing around with the ConBasic option in MakeItC [MiC].
ConB-menu.jpg
ConB-menu.jpg (17.21 KiB) Viewed 20408 times
'
Ran the Hello World example on my ARMStamp board.
and it works -- sort of. I don't think it is coming out of the "breakpoint" routine;
in response the the " ^ ", AFAIK the 'continue' option should print the missing text,
then break; out of the while loop and ....
ConB-menu.jpg
ConB-menu.jpg (17.21 KiB) Viewed 20408 times
ConB-menu.jpg
ConB-menu.jpg (17.21 KiB) Viewed 20408 times
'

Am I not understanding something??
Olzeke
Attachments
HW-breakpoint.jpg
HW-breakpoint.jpg (61.73 KiB) Viewed 20407 times
HW-missing.jpg
HW-missing.jpg (70.01 KiB) Viewed 20407 times



olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: ConBasic- Hello World

Post by olzeke51 »

G'Morning,
I've been 'mucking' around with "Hello World" on the ARMStamp.
These 'usb' family of files seems to be missing from the installation.

Code: Select all

#include "usbd.h"
#include "usbd_rom_api.h"
#include "usb.h"
Could you post them or a link to them??
Thanks- Olzeke
C:/Users/Zwanster/DOCUME~1/Coridium/include/system_LPC11Uxx.c:31:18:
fatal error: usbd.h: No such file or directory compilation terminated.

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: ConBasic- Hello World

Post by basicchip »

If the program is looking for usb files, you are not compiling for C onBASIC. If that is your intention, the files won't be in the include path, which will need ./usb OK, I also see the installer for MakeItC is not copying those, I will update that. For now the files are below

Not sure what the issue with ^ is, I will have to look into that later.
usb.zip
(72.54 KiB) Downloaded 675 times

TodWulff
Posts: 70
Joined: Fri Oct 19, 2012 4:03 am
Location: The Mitten State - Shores of Lake Huron

Re: ConBasic- Hello World

Post by TodWulff »

Can someone please explain what C on Basic is?

Based on the title, it sounds like a means for ARMbasic to compile and run some C source on Basic.

Is this correct?

olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: ConBasic- Hello World

Post by olzeke51 »

Yes
it can do upto a 4k section of code - as that is the Flash limit currently in MiC.
the 'hello world' is set kup for bare-metal OR ConBasic via a #def onBasic.
'
onBasic will incorporate at least 17 (iirc) routines that ARMbasic uses, at your disposal
time, interrupts, usart, print I do believe are the general flavor.
-
It currently is config'd for ARM-Stamp (11u37) and I think the BASICchip (1114)
WELL that was some #ifdefs that I saw in one of the files.
'
HTH -Olzeke

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: ConBasic- Hello World

Post by basicchip »

We did some work with Pokitto. It looks like a cute educational board, and we moved our BASIC to it.

As you know our typical MakeItC overlays BASIC when you compile a program.

As an experiment we wrote a version of some of the example programs and MakeItC to link to BASIC firmware. What this allows is to compile C programs without overwriting the BASIC firmware, and using those firmware routines. it does indeed work for small C programs, we would either need to patch the gcc hex to insert FLash page breaks or the BASIC Flash writer to handle them itself (a bit tougher as MiC loader also needs to pause on those flash pauses).

Where is it going? Who knows. Where is Pokitto going, not sure?

edit -- misspelled Pokitto -- fixed

TodWulff
Posts: 70
Joined: Fri Oct 19, 2012 4:03 am
Location: The Mitten State - Shores of Lake Huron

Re: ConBasic- Hello World

Post by TodWulff »

Nice. Thank you. Much appreciated.

TodWulff
Posts: 70
Joined: Fri Oct 19, 2012 4:03 am
Location: The Mitten State - Shores of Lake Huron

Re: ConBasic- Hello World

Post by TodWulff »

Ok, so I am messing around with MiC & ConBASIC. The end goal is to get Segger's RTT code installed on an Coridium ARMbasic Target. Reportedly, it is only ~500bytes so I feel it might be safe to do so and then make use of it with AB (after getting the ASM from the RTT code compilation effort).

So I delved into my first ever C dev effort on any micro. lulz. Anyways, I followed the getting started section and am somewhat concerned with what I am seeing:
Image

I find it a bit hard to believe that a simple hello world app would consume 35K of compiled code. :)

I did get a TCL error during the compilation about 'adding multicore' (which I presume is due to my having the 54102 target).

Is it safe to presume that the flashing of this would fail, in a ConBASIC context?

TodWulff
Posts: 70
Joined: Fri Oct 19, 2012 4:03 am
Location: The Mitten State - Shores of Lake Huron

Re: ConBasic- Hello World

Post by TodWulff »

Well, it works: ARMbasic still in tact and the C app flashed and executes correctly (mostly - in that I too am seeing what Gary is - the lack of the verbose resumption dialog and exiting the while loop). Regardless, this is pretty friggin cool.
Image

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: ConBasic- Hello World

Post by basicchip »

There have been issues for quite some time on MiC reporting code size. The linker maps were parsed to generate that value, and some maps seem to confuse that reporting.

Yes it is an error, but one that has been ignored for a long time.

C on BASIC was an experiment to evaluate the possibility of the approach, and yes it is possible. As the potential customer for it has seemingly gone away it is frozen in that state. The issue being that the BASIC compiler inserts end of record markers on each Flash block boundary (typically 4K). That informs the loader to wait for the ARM to finish writing the block before continuing with the load.

The loader could be fixed to do those waits automatically (as it does know the block size from the vector table). That would then allow C hex files to be loaded.

#define idx_blksize 58 // start using again in 7.15 -- Flash block size

Post Reply