Go to advanced search

by blippy
Thu Jan 21, 2021 8:02 pm
Forum: General
Topic: I'm excited!
Replies: 18
Views: 476

Re: I'm excited!

Programmable I/O. I've quickly skimmed the datasheet. It will obviously take me some time before i've really grokked what's going on. Let's say, for example, that you wanted to use the Pico that converts ADC and offers the readings over SPI as a slave. Would you say that implementing this design vi...
by blippy
Thu Jan 21, 2021 1:01 pm
Forum: General
Topic: I'm excited!
Replies: 18
Views: 476

Re: I'm excited!

Many mcus have been touted as Arduino-killers over the years, of course. Perhaps the only one that comes close is the ESP32. I've messed around with a variety of mcus - although I consider myself very much a beginner - and I've usually found something to like about all of them. I have good vibes abo...
by blippy
Thu Jan 21, 2021 9:59 am
Forum: General
Topic: I'm excited!
Replies: 18
Views: 476

I'm excited!

I never got switched on by the Raspberry Pi 4, but this product has me intrigued. I've just got to try it. It's not quite my dream machine, but I can't resist giving it a try. I've always thought that there was a market for a hybrid MCU and SBC. It's very difficult to do bare metal interfacing betwe...
by blippy
Tue Dec 22, 2020 9:48 am
Forum: Bare metal, Assembly language
Topic: static vars not initialised
Replies: 14
Views: 796

Re: static vars not initialised

Apologies blippy, No problemo. I didn't intend it to be a complaint. Sometimes sorting out these bugs can be very confusing. I believe the zeroing of .bss is missing from the lab's in my book. If you share I can add it. Sure. My solution is pretty much a standard one. In memory.map, you need to cha...
by blippy
Thu Dec 17, 2020 6:56 pm
Forum: Other projects
Topic: STICKY: The projects list. Look here for some ideas.
Replies: 234
Views: 434972

Re: STICKY: The projects list. Look here for some ideas.

Project idea: xmas tree lights.

Level: beginner

Demo here:

https://youtu.be/20Wpm5a_0P4

Although made with an STM8S microcontoller, the project is eminently suitable for any Raspberry Pi.
by blippy
Sun Dec 06, 2020 10:12 pm
Forum: Bare metal, Assembly language
Topic: static vars not initialised
Replies: 14
Views: 796

Re: static vars not initialised

any variable that is set to 0 gets allocated into the .bss section by default the linker will omit .bss from the actual binary, and the init code is then responsible for zeroing out bss on startup, before entering main() you should then use the linker script to create 2 symbols at the start/end (ob...
by blippy
Sun Dec 06, 2020 9:24 pm
Forum: Bare metal, Assembly language
Topic: static vars not initialised
Replies: 14
Views: 796

static vars not initialised

I don't think my static variables are being set. Suppose I have a simple function:

Code: Select all

void foo()
{
        static void*xxx = 0;
        assert(xxx==0);
}
I run it:

Code: Select all

assertion failed:kernel.c:71:foo():xxx==0
I'm baffled.
by blippy
Sat Dec 05, 2020 9:55 pm
Forum: Windows 10 for IoT
Topic: Raspberry Pi 4 install win10 IOT solution?
Replies: 16
Views: 2597

Re: can anyone help me?

Windows 10 IoT ... It is a dead project Why am I not surprised? When I heard about it, I figured it would never fly as an idea. I think there must have been plenty of astroturfing at the time, saying what a good idea it was. Recently I thought that Win 10 IoT might not have been such a bad idea; ki...
by blippy
Wed Dec 02, 2020 7:18 pm
Forum: Other programming languages
Topic: FORTH Language for RPi ?
Replies: 18
Views: 9441

Re: FORTH Language for RPi ?

karrika wrote:
Wed Dec 02, 2020 6:16 pm
My masters thesis was to write a multi-processor OS entirely in Forth. It consisted of a 16 bit 8086 as a database master and a few Z80 processors running on slices on the 8086 address space.
That sounds like quite an ambitious project for a masters (MPhil, I take it?).
by blippy
Wed Dec 02, 2020 5:30 pm
Forum: Other programming languages
Topic: FORTH Language for RPi ?
Replies: 18
Views: 9441

Re: FORTH Language for RPi ?

I had been toying with a Forth here: https://github.com/blippy/circle/tree/master/sample/m01-forth It is a very numpty implementation so far. Still, Forth on "bare metal", not bad. Actually, it is a fork of rst's excellent Circle OS, with a forth project that I added. forth.cpp is just a l...
by blippy
Wed Dec 02, 2020 1:42 pm
Forum: Bare metal, Assembly language
Topic: Why is the free running counter set to 3E?
Replies: 5
Views: 485

Re: Why is the free running counter set to 3E?

This might be helpful to someone: The APB (Advanced Peripheral Bus) operates at 250MHz on the Pi 3. So, apb_clock = 250000000 for the purposes of the formula in BCM2837 p199: timer_clock = apb_clock/(pre_divider+1) This formula is correct. The pre-divider is situated in base+0x41C, which has a defau...
by blippy
Tue Dec 01, 2020 3:08 pm
Forum: Bare metal, Assembly language
Topic: Why is the free running counter set to 3E?
Replies: 5
Views: 485

Re: Why is the free running counter set to 3E?

Arm Ltd sells peripheral IP cores. The PL011 UARTs in the Pi SoC is one of them. SP804 is https://developer.arm.com/documentation/ddi0271/d/ My understanding so far: it seems the SP804 can safely be ignored. The Pi provides one AT (ARM Timer) and one FRC (Free Running Counter). The AT's frequency c...
by blippy
Tue Dec 01, 2020 1:09 pm
Forum: Bare metal, Assembly language
Topic: Why is the free running counter set to 3E?
Replies: 5
Views: 485

Re: Why is the free running counter set to 3E?

Just a little update to add more confusion ... The documentation makes reference to the "standard SP804 time control register", which apparently doesn't exist anyway. I'm not sure what the 804 is supposed to be anyway. But anyhoo ... At base+0x41C, the default value is 0x7D (p198). This is...
by blippy
Tue Dec 01, 2020 11:14 am
Forum: Bare metal, Assembly language
Topic: Why is the free running counter set to 3E?
Replies: 5
Views: 485

Why is the free running counter set to 3E?

On p197 of the BCM2835 datasheet it describes the TCR (timer control register). Bits 23:16 of base+0x40C are set to 0x3E by default, which is for the free running counter pre-scaler. It states that freq = sys_clk/(prescaler+1). Firstly, what is the value of sys_clk? I've seen 250MHz quotes in one pl...
by blippy
Sun Nov 29, 2020 12:17 pm
Forum: Bare metal, Assembly language
Topic: "Low Level Devel"s video series
Replies: 0
Views: 433

"Low Level Devel"s video series

I spotted an interesting YouTube channel on bare metal development that I thought people might be interested in:
https://www.youtube.com/channel/UCRWXAQ ... 1Xg/videos

Not sure if it's been posted before. Maybe the author is on this forum.
by blippy
Wed Nov 25, 2020 11:44 am
Forum: Bare metal, Assembly language
Topic: Seen one FAT32, seen them all?
Replies: 13
Views: 507

Seen one FAT32, seen them all?

I've always found using SD cards with microcontrollers to be a bit of a hit-and-miss affair, and never really gotten to the bottom of it. I was looking through someone's else code the other day, and discovered that there is more than one FAT32 partition Id. This got me to wondering if, actually, the...
by blippy
Tue Nov 24, 2020 9:16 pm
Forum: Bare metal, Assembly language
Topic: Optimisation causes crashes (??)
Replies: 13
Views: 924

Re: Optimisation causes crashes (??)

Thanks guys. In the end I decided to implement things a different way. Taking a different tack, I was able to incorporate bzt's SD card work in with a fork of Sean's tutorials. I'm pretty excited about this because I now have a bare metal system that has a screen, keyboard, and storage. Admittedly ...
by blippy
Tue Nov 24, 2020 9:16 pm
Forum: Bare metal, Assembly language
Topic: Optimisation causes crashes (??)
Replies: 13
Views: 924

Re: Optimisation causes crashes (??)

Thanks guys. In the end I decided to implement things a different way. Taking a different tack, I was able to incorporate bzt's SD card work in with a fork of Sean's tutorials. I'm pretty excited about this because I now have a bare metal system that has a screen, keyboard, and storage. Admittedly ...
by blippy
Sun Nov 22, 2020 3:19 pm
Forum: Bare metal, Assembly language
Topic: Optimisation causes crashes (??)
Replies: 13
Views: 924

Re: Optimisation causes crashes (??)

Thanks guys. In the end I decided to implement things a different way. So I've got a "mostly working" version of Forth on Circle, which is pretty cool. It fits in with the idea of a retro computing environment where you have a control language. Not sure what the best choice is, though: it'...
by blippy
Tue Nov 17, 2020 3:26 pm
Forum: Bare metal, Assembly language
Topic: Optimisation causes crashes (??)
Replies: 13
Views: 924

Re: Optimisation causes crashes (??)

rst wrote:
Tue Nov 17, 2020 2:48 pm
You only have to add the following to the application's Makefile:

Code: Select all

...
OPTIMIZE = -O3

include $(CIRCLEHOME)/Rules.mk
...
Ah, OK. Good tip. Thanks for that.
by blippy
Tue Nov 17, 2020 11:54 am
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 317
Views: 99147

Re: Circle - C++ bare metal environment (with USB)

Circle is based on Linux so the USB host driver has a lot of Linux system dependencies, as you mentioned (hence Circle OS). . I didn't know that Circle borrowed a lot from Linux. I had assumed it was a ground-up implementation. My own dream goal is to have a kind-of "unikernel" that makes...
by blippy
Tue Nov 17, 2020 9:16 am
Forum: Bare metal, Assembly language
Topic: Optimisation causes crashes (??)
Replies: 13
Views: 924

Re: Optimisation causes crashes (??)

Based on the behavior (add a function call as well as optimization off works, etc.) I would suspect an issue with the stack. A local variable that is exceeding its size allocation, such as storing a string in an array that is not large enough? Sounds fun. :roll: My program implements my own home-br...
by blippy
Tue Nov 17, 2020 8:55 am
Forum: Bare metal, Assembly language
Topic: Optimisation causes crashes (??)
Replies: 13
Views: 924

Re: Optimisation causes crashes (??)

What are your optimisations when it does and doesn't crash ? There are some bits of Circle which have to be -O2, though they seem to be getting less and less. Formerly, I didn't touch any optimisation parameters. I just did a compile using Circle defaults. Then I changed Rules.mk to add the CFLAGS ...
by blippy
Mon Nov 16, 2020 9:50 pm
Forum: Bare metal, Assembly language
Topic: Optimisation causes crashes (??)
Replies: 13
Views: 924

Optimisation causes crashes (??)

Something very strange. I'm using Circle OS, doing bare metal programming. Very usefully, it produces a stack trace when the whole thing goes wrong. At first the stack trace was a mystery, but then it kinda started making a little sense when I looked at the disassembly, I'm rubbish at reading disass...
by blippy
Mon Nov 16, 2020 4:16 pm
Forum: Bare metal, Assembly language
Topic: Circle - C++ bare metal environment (with USB)
Replies: 317
Views: 99147

Re: Circle - C++ bare metal environment (with USB)

I'd just like to publicly thank Rene for all the work he has done Circle is really neat. There's a few guys on here who have done amazing work (thanks also go to Sean Lawless. I'm really planning on getting his book). My only lamentation is that there's a lot of code that is necessary to get the ha...

Go to advanced search