Browse Source

Add readmes and licenses.

master
flabbergast 6 years ago
parent
commit
8e3c5355b8
  1. 11
      README.md
  2. 13
      boards/README.md
  3. 6
      boards/STM32F030_BREAKOUT/board.h
  4. 6
      boards/STM32F042_BREAKOUT/board.h
  5. 6
      boards/ST_NUCLEO_F072RB/board.h
  6. 6
      projects/f030-blink/main.c
  7. 3
      projects/f030-serial-echo/README.md
  8. 6
      projects/f030-serial-echo/main.c
  9. 3
      projects/f042-button-led/README.md
  10. 6
      projects/f042-button-led/main.c
  11. 5
      projects/f042-usb-cdc/README.md
  12. 6
      projects/f042-usb-cdc/main.c
  13. 17
      projects/f072-teensy-debug-simple/README.md
  14. 7
      projects/f072-teensy-debug-simple/main.c
  15. 5
      projects/f072-teensy-debug-simple/usb_hid_debug.c
  16. 7
      projects/f072-teensy-debug-simple/usb_hid_debug.h
  17. 17
      projects/f072-teensy-debug/README.md
  18. 11
      projects/f072-teensy-debug/main.c
  19. 9
      projects/f072-teensy-debug/usb_hid_debug.h
  20. 5
      projects/f072nucleo-demo/README.md
  21. 6
      projects/f072nucleo-demo/main.c
  22. 3
      projects/keyb/usb_main.c

11
README.md

@ -0,0 +1,11 @@
# chibios-projects
Several examples for ChibiOS 3.0.x (some very close to original ChibiOS demos), to be used with arm-none-eabi GCC toolchain, Makefiles and plain text editing. (So no fancy eclipse projects, etc...)
The structure is made so that it is easy to upgrade ChibiOS to a newer one (no changes to the distribution tree are required), just replace the `chibios` symlink.
The `Makefile`s are adjusted so that it is easy to add new board definitions (`boards`) and linker scripts (`ld`). These take precedence over ChibiOS provided ones if needed.
The actual examples are to be found in the `projects` directory.
Several flashing methods are set up in `common.mk` (e.g. `make dfu` works).

13
boards/README.md

@ -0,0 +1,13 @@
# Extra board definitions for ChibiOS
## ST_NUCLEO_F072RB
For the [NUCLEO_F072RB](http://www.st.com/web/en/catalog/tools/PF260003) board.
## STM32F030_BREAKOUT
For [this](https://oshpark.com/shared_projects/4C05TXl3) STM32F030FxP6 breakout.
## STM32F042_BREAKOUT
For [this](https://oshpark.com/shared_projects/2ESB57Jk) STM32F042FxP6 breakout.

6
boards/STM32F030_BREAKOUT/board.h

@ -1,3 +1,9 @@
/*
* (c) 2015 flabbergast <s3+flabbergast@sdfeu.org>
* Based on ChibiOS 3.0.1 board definitions, license below.
* Licensed under the Apache License, Version 2.0.
*/
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio

6
boards/STM32F042_BREAKOUT/board.h

@ -1,4 +1,10 @@
/*
* (c) 2015 flabbergast <s3+flabbergast@sdfeu.org>
* Based on ChibiOS 3.0.1 board definitions, license below.
* Licensed under the Apache License, Version 2.0.
*/
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
Licensed under the Apache License, Version 2.0 (the "License");

6
boards/ST_NUCLEO_F072RB/board.h

@ -1,3 +1,9 @@
/*
* (c) 2015 flabbergast <s3+flabbergast@sdfeu.org>
* Based on ChibiOS 3.0.1 board definitions, license below.
* Licensed under the Apache License, Version 2.0.
*/
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio

6
projects/f030-blink/main.c

@ -1,3 +1,9 @@
/*
* (c) 2015 flabbergast <s3+flabbergast@sdfeu.org>
* Based on ChibiOS 3.0.1 demo code, license below.
* Licensed under the Apache License, Version 2.0.
*/
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio

3
projects/f030-serial-echo/README.md

@ -0,0 +1,3 @@
# Serial echo example
Supposed to run on a STM32F030x4 breakout board, assumes the serial connection on USART1, pins PA9 (TX) and PA10 (RX).

6
projects/f030-serial-echo/main.c

@ -1,3 +1,9 @@
/*
* (c) 2015 flabbergast <s3+flabbergast@sdfeu.org>
* Based on ChibiOS 3.0.1 demo code, license below.
* Licensed under the Apache License, Version 2.0.
*/
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio

3
projects/f042-button-led/README.md

@ -0,0 +1,3 @@
# An example with a LED and a button
Supposed to run on STM32F042FxP6 breakout board. A button press toggles the LED on/off.

6
projects/f042-button-led/main.c

@ -1,3 +1,9 @@
/*
* (c) 2015 flabbergast <s3+flabbergast@sdfeu.org>
* Based on ChibiOS 3.0.1 demo code, license below.
* Licensed under the Apache License, Version 2.0.
*/
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio

5
projects/f042-usb-cdc/README.md

@ -0,0 +1,5 @@
# USB-CDC example for STM32F042
Supposed to run on STM32F042FxP6 breakout board. Should enumerate as a serial device over USB. A button press should produce a "Hello, world" message over the the serial/USB pipe.
The USB connection is on PA11/PA12 pins, which share the physical pins with PA9/PA10 on the TSSOP-20 STM32F042FxP6 chips.

6
projects/f042-usb-cdc/main.c

@ -1,3 +1,9 @@
/*
* (c) 2015 flabbergast <s3+flabbergast@sdfeu.org>
* Based on ChibiOS 3.0.1 demo code, license below.
* Licensed under the Apache License, Version 2.0.
*
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio

17
projects/f072-teensy-debug-simple/README.md

@ -0,0 +1,17 @@
# A Teensy-style "debug" channel over USB raw HID
## A simple version
This example implements a raw HID device, which is able to send "debug" messages, akin to the original [Teensy] [usb_debug_only] example.
This version does *not* implement the hid debug channel as a class, it simply provides a couple of functions to write to it, Teensy-style.
The version does not implement the flush timer, the output needs to be flushed manually by calling `usb_debug_flush_output()`.
It is compatible with the original PJRC's [hid_listen] program, but a simple python reimplementation is provided (requires the [hidapi] module, i.e. `pip install hidapi`).
[Teensy]: https://www.pjrc.com/teensy/index.html
[usb_debug_only]: https://www.pjrc.com/teensy/usb_debug_only.html
[hid_listen]: https://www.pjrc.com/teensy/hid_listen.html
[hidapi]: https://github.com/trezor/cython-hidapi

7
projects/f072-teensy-debug-simple/main.c

@ -1,3 +1,10 @@
/*
* Copyright (c) 2015 flabbergast <s3+flabbergast@sdfeu.org>
*
* Based on the work of Guillaume Duc, original licence below.
* The original license applies to the whole current file.
*/
/*
Copyright (c) 2014 Guillaume Duc <guillaume@guiduc.org>

5
projects/f072-teensy-debug-simple/usb_hid_debug.c

@ -6,6 +6,11 @@
*
* Some code also based on the USB Serial implementation
* in ChibiOS 3.0.1, see the license in ChibiOS.
*
* Finally, the print helpers are originally from
* http://www.pjrc.com/teensy/
* Copyright (c) 2008 PJRC.COM, LLC
* - see the license towards the end of this file.
*/
/*

7
projects/f072-teensy-debug-simple/usb_hid_debug.h

@ -1,3 +1,10 @@
/*
* Copyright (c) 2015 flabbergast <s3+flabbergast@sdfeu.org>
*
* Based on the work of Guillaume Duc, original licence below.
* The original license applies to the whole current file.
*/
/*
Copyright (c) 2014 Guillaume Duc <guillaume@guiduc.org>

17
projects/f072-teensy-debug/README.md

@ -0,0 +1,17 @@
# A Teensy-style "debug" channel over USB raw HID
## A BaseAsynchronousChannel version
This example implements a raw HID device, which is able to send "debug" messages, akin to the original [Teensy] [usb_debug_only] example.
This version implements the debug-out as an instance of ChibiOS's BaseAsynchronousChannel, so one can use ChibiOS's BaseChannel functions to write to it.
The output is automatically flushed after 50ms (see `usb_hid_debug.h`), or immediately by calling `usb_debug_flush_output()`.
It is compatible with the original PJRC's [hid_listen] program, but a simple python reimplementation is provided (requires the [hidapi] module, i.e. `pip install hidapi`).
[Teensy]: https://www.pjrc.com/teensy/index.html
[usb_debug_only]: https://www.pjrc.com/teensy/usb_debug_only.html
[hid_listen]: https://www.pjrc.com/teensy/hid_listen.html
[hidapi]: https://github.com/trezor/cython-hidapi

11
projects/f072-teensy-debug/main.c

@ -1,3 +1,10 @@
/*
* Copyright (c) 2015 flabbergast <s3+flabbergast@sdfeu.org>
*
* Based on the work of Guillaume Duc, original licence below.
* The original license applies to the whole current file.
*/
/*
Copyright (c) 2014 Guillaume Duc <guillaume@guiduc.org>
@ -54,10 +61,6 @@ static THD_FUNCTION(buttonThread, arg) {
if(usbGetDriverStateI (&USBD1) == USB_ACTIVE) {
chSysUnlock();
chnWrite((BaseChannel *)&HIDD, (uint8_t *)"Hello, world!\n", 14);
// print("button state is ");
// usb_debug_putchar('0'+wkup_cur_state);
// usb_debug_putchar('\n');
//usb_debug_flush_output(&HIDD);
}
else
chSysUnlock();

9
projects/f072-teensy-debug/usb_hid_debug.h

@ -1,3 +1,10 @@
/*
* Copyright (c) 2015 flabbergast <s3+flabbergast@sdfeu.org>
*
* Based on the work of Guillaume Duc, original licence below.
* The original license applies to the whole current file.
*/
/*
Copyright (c) 2014 Guillaume Duc <guillaume@guiduc.org>
@ -33,7 +40,7 @@
* - this much gets transmitted with every IN packet
*/
#define DEBUG_TX_SIZE 5
#define DEBUG_TX_SIZE 8
/*
* Teensy HID debug IN endpoint number

5
projects/f072nucleo-demo/README.md

@ -0,0 +1,5 @@
# An example for ST F072-NUCLEO board
It is basically just an adaptation of ChibiOS's `demos/STM32/RT-STM32F072-DISCOVERY` to the F072-NUCLEO board, for testing the board definition for this NUCLEO board.
This NUCLEO board has USART2 routed to its ST-LINK, which enumerates (among other things) as a serial port. On the USER button press, the board runs tests and prints the output over this serial port.

6
projects/f072nucleo-demo/main.c

@ -1,3 +1,9 @@
/*
* (c) 2015 flabbergast <s3+flabbergast@sdfeu.org>
* Based on ChibiOS 3.0.1 demo code, license below.
* Licensed under the Apache License, Version 2.0.
*/
/*
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio

3
projects/keyb/usb_main.c

@ -804,12 +804,11 @@ static bool usb_request_hook_cb(USBDriver * usbp) {
switch(usbp->setup[4]) { // LSB(wIndex) (check MSB==0?)
case KBD_INTERFACE:
#ifdef NKRO_ENABLE
case NKRO_INTERFACE:
case NKRO_INTERFACE:
#endif
usbSetupTransfer(usbp, (uint8_t *)&keyboard_report_sent, sizeof(keyboard_report_sent), NULL);
return TRUE;
break;
// TODO: also got GET_REPORT for NKRO on linux
default:
usbSetupTransfer(usbp, NULL, 0, NULL);
return TRUE;

Loading…
Cancel
Save