463 Commits

Author SHA1 Message Date
Per Mårtensson
75bd97a3a2 Add a fourth drive on the shugart bus (index 3)
This drive is selected with pin 6 on the floppy header.
2025-10-27 21:25:53 +00:00
Keir Fraser
e157ca3585 Merge per-board msel_pins with user_pins
This allows users to modify pins that they are not using for MSEL
purposes. Additionally it allows any defined user pin to be used
for MSEL purposes. Specifically, this will allow user pin 6 to be
used as a fourth drive-select line on the Shugart bus.
2025-10-27 16:51:36 +00:00
Per Mårtensson
7251d36c20 Use .thumb_func directive consistently when declaring Thumb asm functions
This is required with newer toolchains.
2025-10-27 10:47:32 +00:00
Keir Fraser
a9856039d3 Makefile: Remove old flash/serial targets 2024-12-10 11:02:02 +00:00
Keir Fraser
5d1d1ee516 dist: Create DFU files in addition to HEX 2024-12-10 11:02:02 +00:00
Keir Fraser
955ccb910d usb: Do not delay 500ms when mode-switching (USB disconnect/reconnect)
This is not required by the USB spec and in fact seems to make
re-connection *more* unreliable when connected via a USB hub.

Refs keirf/greaseweazle#338
2024-12-05 09:30:07 +00:00
Keir Fraser
23b19de571 Use raw strings for regexes; fixes SyntaxWarning: invalid escape sequence 2024-12-05 08:23:00 +00:00
Keir Fraser
98fc55679d gnumake: Provide cc_rule and as_rule constructors
Use these to dynamically construct a rule for at32f4/fpec.o
2024-11-21 15:53:41 +00:00
Keir Fraser
b1fa16d429 DWC OTG: Fix an assertion check on rx buffer allocation 2024-11-03 15:22:29 +00:00
Keir Fraser
45821dee07 New intrinsic "unreachable()" to indicate unreachable code points
This allows better compiler optimisation, while also including an
ASSERT() for debug builds.

Refs #7
2024-11-03 10:26:15 +00:00
Keir Fraser
c839984a5f Update to v1.6 v1.6 2024-09-28 08:34:53 +01:00
Keir Fraser
8b8d4a61cf WRITE_FLUX: Hard-sector index detection
Expected sector timing is specified to the WRITE_FLUX command. This
allows detection of short sector times, which indicate the true
track start ("track index"). This allows write cueing as for
soft-sectored disks.
2024-09-28 00:58:30 +01:00
Keir Fraser
5b0857791f New delay parameter: index_mask
Allows configuration of post-trigger INDEX mask time in microseconds
(0-65535). Some drives may need much longer than the default, if
there is sensor-switch bounce on trailing edge of the INDEX pulse.

Fixes keirf/greaseweazle#7
2024-09-24 18:38:36 +01:00
Keir Fraser
1da90a030d github: Update workflow actions to latest versions 2024-09-23 12:24:27 +01:00
Keir Fraser
d45f4243f2 Implement asynchronous operation delays between seek/head/read/write
Also implement the pre- and post-write delays required by many floppy
drive specs.

Refs keirf/greaseweazle#491
2024-09-23 12:23:41 +01:00
Keir Fraser
2b1c541380 Remove arbitrary 100-cylinder constraint on seek commands. 2024-01-30 16:41:16 +00:00
Keir Fraser
4b5db978e9 Update to v1.5 v1.5 2023-12-19 07:17:48 +00:00
Keir Fraser
191d68f41b usb: Fix device_qualifier descriptor length
The descriptor was missing the bReserved field, which must be zero.
This resulted in an out-of-bounds array copy when transmitting the
device_qualifier descriptor, and possible transmission of garbage
for the bReserved field.

This is based on PR #5 created by kimstik@github
2023-10-03 18:41:36 +01:00
Keir Fraser
b41091017c Fix GCC 12 infinite loop in strlen
Strlen was jumping to strlen as part of -ftree-loop-distribute-patterns.
Seems this sort of issue can be common and generally fixed with
-fno-builtin. However, some of those optimizations may be useful and I
don't think our semantics for the functions are wildly different than
the standard, so I'm fixing this surgically with
-ftree-loop-distribute-patterns to just util.c. That may be the wrong
call, so if this bites us again, let's go more aggressive.

[Above is commit message from FlashFloppy, which also references
FlashFloppy GitHub issue 660.]
2023-10-03 18:23:57 +01:00
Keir Fraser
2d1a14247b GCC12: Convert array comparisons to pointer-to-first-element comparisons.
These are equivalent, but the former is deprecated in C++20 and warned by GCC12.

[The above message is from an earlier equivalent commit in FlashFloppy.
It is also equivalent to part of PR #5 created by kimstik@github]
2023-10-03 17:57:21 +01:00
Keir Fraser
12c2c357c8 STM32F1, AT32F4, USB: Simplify ISTR handling
We should only clear set bits, and we should only do that in the
ISTR central dispatcher.
2023-08-17 17:38:01 +01:00
Keir Fraser
c5b6894a64 CMD_GET_INFO: New field 'usb_buf_kb' 2023-08-17 17:09:44 +01:00
Keir Fraser
34daf529c7 Allow 16-bit cylinder number. 2023-08-16 19:56:34 +01:00
Keir Fraser
453a1211a0 AT32F403: Extend SRAM to 224kB 2023-08-16 19:56:23 +01:00
Keir Fraser
1a35995046 AT32F403A: Extend SRAM to 224kB 2023-08-16 19:56:22 +01:00
Keir Fraser
1b742920a5 Update to v1.4 v1.4 2023-07-22 21:50:52 +01:00
Keir Fraser
80b899925c AT32F4: Support new board V4.1 2023-07-21 11:01:58 +01:00
Keir Fraser
c0bc1b190a Upgrade gh-actions to Ubuntu 22.04
The newer GCC does a better job of reducing code size.
2023-07-17 18:23:55 +01:00
Keir Fraser
0a38ab8846 V4: Further restrict duplication of Act LED to TXO
Only the original V4 board requires this. The V4.1 board has a pin
header for the original Act signal.

Also make it clear that the duplication happens only on 403(A)
MCUs. It is not possible on 415 as it affects USB operation.
2023-07-14 14:26:06 +01:00
Keir Fraser
f2a0ed4094 STM32F7, AT32F4: Replace open-coded references to PB13 with {gpio_led, pin_led} 2023-07-14 14:26:01 +01:00
Keir Fraser
ee02a86e80 time: Proactive pull from FlashFloppy for 32-bit timebase update period
Make the period proportional to systick rate by updating the timebase
every 2^23 systicks. This will always be safe, no matter how high the
systick rate.
2023-07-14 14:24:03 +01:00
Keir Fraser
ca7447ceac timer: Proactive pull from FlashFloppy for coarse-deadline handling
Set the coarse deadline only 1ms early, as 1ms is sure to be within
range of 2^16 systicks (at up to approx 500MHz core clock).
2023-07-14 14:18:28 +01:00
Keir Fraser
f3a0110eea README.md: Update links 2023-06-03 15:21:12 +01:00
Keir Fraser
44ed7fca95 Update to v1.3 v1.3 2023-02-18 09:22:05 +00:00
Keir Fraser
71dc5838bf usb: Handle GET_REQUEST (Device) as required by USB specification.
Fixes greaseweazle issue 282
2023-02-18 09:17:12 +00:00
Keir Fraser
42d38e8a9d Makefile: Fix the flash-to-device helper rules 2023-02-08 10:43:42 +00:00
Keir Fraser
09f777ea49 AT32F403A: Run main firmware at 216MHz. Clock USB from auto-calibrated HSI clock. 2023-01-05 10:30:42 +00:00
Keir Fraser
a7cfcf0482 blinky: Fix serial baud rate. Should be 115200. 2022-11-15 07:56:27 +00:00
Keir Fraser
651bffae95 console: All chips run USART1 on APB2 at APB2 speed. 2022-11-14 16:58:48 +00:00
Keir Fraser
eef5390657 Define AHB, APB1, APB2 bus speeds as numeric constants for all supported chips. 2022-11-14 16:56:57 +00:00
Keir Fraser
89c67939b6 at32f4: Make the f4.h header file stand alone. 2022-11-14 16:46:29 +00:00
Keir Fraser
f570dd5cfe github: Rewrite release creation rules 2022-11-07 08:26:50 +00:00
Keir Fraser
db12862cc6 github: Use latest supported actions and rewrite usage of obsolete set-output command 2022-11-06 19:53:46 +00:00
Keir Fraser
0854bebcea Update to v1.2 v1.2 2022-07-18 10:50:43 +01:00
Keir Fraser
fd07efedcf GETINFO_FIRMWARE: Return MCU information 2022-07-18 10:29:43 +01:00
Keir Fraser
8ecea89ea8 Support AT32F403A MCU on F1 board 2022-07-18 09:42:58 +01:00
Keir Fraser
bd91422c2d Support AT32F403A MCU on V4 board 2022-07-18 09:42:30 +01:00
Keir Fraser
0d3b45c2ad Makefile: Replace rsync with individual mkdir in pattern rule
Also add + to mkdir lines to fix --dry-run.
2022-07-10 10:31:08 +01:00
Keir Fraser
b6f2860726 RELEASE_NOTES: Fix Greaseweazle VID 1201 -> 1209.
Fixes #2
2022-04-21 11:02:22 +01:00
Keir Fraser
b593fa973c Reserve BUSTYPE ID 3 for Adafruit_Floppy project 2022-04-19 21:30:45 +01:00