m68hc11-gcc-3.3.6 on modern Linux - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: August 01, 2019, 12:06:13 pm
content: This is a note for those who are tying to crosscompile gcc for hc11.so, I have recently switched to a new i9 computer, and yesterday it was time to move my toolchain to a new Linux stage4. I still have projects made on hc11, so it was also time to recompile the cross-compiler toolchain for the new userland.Code:binutils-2.25gcc-core-3.3.6binutils had no problem, but compiling gcc-3.3.6 failed of being compiled by gcc-8.3.0, gcc-7.3.0, ... because they both claim that source are too dirty, so at the end of the day, I tried to emerge the old gcc-4.1.2 and found that it has a problem with the new sys-libs/glibc-2.29.Code:2019-07-31 - [ =sys-devel/gcc-4.1.2 ] - failure - root@dev2.30/7.3.02019-07-31 - [ =sys-devel/gcc-4.1.2 ] - failure - root@dev2.30/8.3.02019-07-31 - [ =sys-devel/gcc-4.1.2 ] - failure - root@dev2.30/8.3.1After some digging, I found the problem was around "struct ucontext", for which gcc was moaning a lot of errors.Code:--- gcc/config/i386/linux-unwind.h.original 2019-07-31 21:03:38.141755272 -0000+++ gcc/config/i386/linux-unwind.h 2019-07-31 21:04:02.384757269 -0000@@ -51,7 +51,7 @@if (*(unsigned char *)(pc+0) == 0x48&& *(unsigned long *)(pc+1) == 0x050f0000000fc0c7){- struct ucontext *uc_ = context->cfa;+ ucontext_t *uc_ = context->cfa;/* The void * cast is necessary to avoid an aliasing warning.The aliasing warning is correct, but should not be a problembecause it does not alias anything. */@@ -139,7 +139,7 @@siginfo_t *pinfo;void *puc;siginfo_t info;- struct ucontext uc;+ ucontext_t uc;} *rt_ = context->cfa;/* The void * cast is necessary to avoid an aliasing warning.The aliasing warning is correct, but should not be a problemand specifically the above patch rappresents what has been changed with the new glibc.Now I haveCode: i686-pc-linux-gnu-4.1.2 * i686-pc-linux-gnu-7.3.0 i686-pc-linux-gnu-8.3.0 i686-pc-linux-gnu-8.3.1and by choosing gcc-4.1.2 as the "host C compiler" I finally resolved issue and I was finaly able to compile gcc-3.3.6 for hc11

author: joeqsmith
author_rank: Super Contributor
timestamp: August 01, 2019, 12:16:15 pm
content: About 40 years late to the party, but still pretty slick.I take it you still need to support these devices.

author: legacy
author_rank: Super Contributor
timestamp: August 01, 2019, 01:39:42 pm
content: @joeqsmithA few of my customers still use HC11 in the oil stations, and weird stations located around the North Pole. I dunno for what, but I know it's the hc11-K4 version able to address up to 1Mbyte of (paged) RAM. It runs to run a micro-scheduler, so each task is physically segregated into a page of ram, with an added 2K dual-port ram used to move data between tasks and between the MPU and the data-concentrator.Someone has also synthesized anHC11 softcore, and there are also versions "under steroids", with ethernet, DMAs, more uarts, more SPIs, more timers, PLL, etc.That's cool, the hc11 is still alive

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 01, 2019, 01:55:11 pm
content: Oh yeah. I've seen a few devices that still use a 68HC11 core either soft on FPGA or even hard on ASICs. Same for 6502 cores actually...

author: joeqsmith
author_rank: Super Contributor
timestamp: August 01, 2019, 02:02:56 pm
content: That's pretty funny that they offer a softcore now. I rolled my own version of the 11 in the 90s. It was for the learning experience more than anything. I was adding some custom instructions but the FPGAs I was using were a bit limited compared with what we have today. An understatement...We used to use the 11E9s. I've built a few things using them for my own hobby. The last thing I made was a reverse Ethernet print server. Hooks to a standard Centronics port and sends the data to a printer over Ethernet. I used an 8MHz part for that. After installing an 8MHz part in the ICE and upping the clock, the ICE wouldn't run. I ended up adding a crap load of bypass to the circuit boards and maybe some termination to get it working.To have some sort of chance of it working, I tossed the C and rolled it in assembler. Writing the Ethernet stack in assembler for an 11, was a fun project.

author: legacy
author_rank: Super Contributor
timestamp: August 01, 2019, 03:55:56 pm
content: Quote from: SiliconWizard on August 01, 2019, 01:55:11 pmWhich core? that core? or .. something "OpenCore" ?

author: SiliconWizard
author_rank: Super Contributor
timestamp: August 01, 2019, 04:10:25 pm
content: I think those were commercial IPs for the HC11, I don't remember from which company.The 6502 core had been written in-house in VHDL.

author: legacy
author_rank: Super Contributor
timestamp: August 01, 2019, 04:17:03 pm
content: Quote from: joeqsmith on August 01, 2019, 02:02:56 pmDid you use CS8900 Ethernet chip made by Cirrus Logic, the 5V version?(guys, be aware that the version for sale at Olimex is the 3.3V version and it's not 5V tolerant)if so, aren't interrupt bugged when the chip is used in 8bit mode?