Skip to content

IDE Detection Issues - #8

Open
infusixllc wants to merge 2 commits into
firebee-org:masterfrom
infusixllc:ide-detection-fix
Open

IDE Detection Issues#8
infusixllc wants to merge 2 commits into
firebee-org:masterfrom
infusixllc:ide-detection-fix

Conversation

@infusixllc

Copy link
Copy Markdown

My Firebee has failed bus transceiver that goes to CF/IDE.

The issue that is happening is similar whether this transciever is currently failing or if the CF card is just unplugged.

It starts when the IDE register is read. pio_cycle_time is detected, on my firebee this comes back -16 due to a failed IDE bus trasceiver. A similar situation happens when the card is unplugged as it instead just returns 0 when something times out.

In either case the get_speed function returns -1. In the parent function this causes one or both higher bits to be written when setting speed. Bits 16-17 or 20-21 of F0040000 should be written with 0-3 only as in Fredi BaS but instead due to the negative return causes the higher bits to be written.

For unknown reasons this causes dramatic interrupt failures on my firebee. The MFP registers read 0 when read and the system locks. What are the meaning of the higher bits and how do they cause the failure? I don't know.

But this PR fixes the issue. Needs to be checked against Firebees with working IDE/CF.

@DavidGZ

DavidGZ commented Jun 4, 2026

Copy link
Copy Markdown
Member

I just hit the same problem. I wanted to boot from the SD card, and EmuTOS froze. I was already investigating the EmuTOS sources when I read your post on the ACP forum. You saved me a lot of time, thanks! :-)

The diagnosis is correct, but I think the solution should be different. According to this line:

#define ACP_CONFIG_REG_SPEED_U0 (3 << 16) /* Slow (3), Middle (2), Fast (1), No drive (NEG) */

The speed should be negative when the drive is not responding. Therefore, the problem is that the speed value should be masked with 0xF before being written to the register.

I have tested this approach, and it works here.

@DavidGZ

DavidGZ commented Jun 4, 2026

Copy link
Copy Markdown
Member

It should be fixed with commit 59fae74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants