Commit Graph

2696 Commits

Author SHA1 Message Date
Denis Feklushkin f5192dbcb5 mk: genlink: simplify variable usage 2020-11-28 22:13:25 +00:00
Brian Viele e41ac6ea71 stm32: added peripheral clock get helpers for all stm32 platforms.
Allows for abstraction for code that's dependent on knowing the source clock
for a peripheral. Implemented a few core peripherals that tend to have clock
tree differences between platforms (USART, timers, I2C, SPI).
2020-11-28 22:13:25 +00:00
Kevin Stefanik df55d45cc1 pac55xx: add usart definitions and basic support code. 2020-11-28 22:13:25 +00:00
Kevin Stefanik 253a091936 pac55xx: adding memctl for flash/sram access, and clock/pll configuration functions.
Merge-conflict: took _prior_ verision of CCS_MUXSELR_MASK_PIN as
bracketing of (pin) seemed more correct!
2020-11-28 22:13:25 +00:00
Kevin Stefanik 245761f894 pac55xx: implemented CAN module interface for qorvo pac55xx. 2020-11-28 22:13:25 +00:00
Karl Palsson cb83273416 stm32: dcmi: drop redundant @ingroups
@ingroup is only needed if you want to assign a doxygen group to
something other than the naturally containing outer group.
2020-11-28 22:13:25 +00:00
Karl Palsson daf99b9b76 stm32: dcmi: hook up doxygen again
We still need stub .c files as we're using shared common files, so .d
tracking doesn't work.  It lets us setup basic introductory text anyway,
and there will be .c files eventually, so acceptable.
2020-11-28 22:13:25 +00:00
Nikolai Smolyaninov 071d4680ec stm32f4/7: DCMI: extract common registers
And enable for the f7

Originally filed as: https://github.com/libopencm3/libopencm3/pull/1208
Rviewed-by: Karl Palsson <karlp@tweak.net.au>
2020-11-28 22:13:25 +00:00
Karl Palsson 81d1b2cfb6 gendoxylist: make it not "crash" if you try interactively at least 2020-11-28 22:13:25 +00:00
Graham Keeth d4d4c798a6 add usb audio, cdc, and midi stub files for doxy
- add stub files to relevant makefiles
- include <stdint.h> in respective headers to fix compilation
2020-11-28 22:13:25 +00:00
Ben Brewer 05f07c1051 stm32f3: Add support for OPAMP 2020-11-28 22:13:25 +00:00
Fabio Pugliese Ornellas 2a4cf034c7 usb: dwc_otg: Add OTG_DSTS_SUSPSTS
Originally filed as: https://github.com/libopencm3/libopencm3/pull/1224

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2020-11-28 22:13:25 +00:00
Themroc d8d63b3184 stm32: timer common all: Fix documentation
Provide gpio examples for both f1 and "everyone else" gpio blocks

Originally filed at: https://github.com/libopencm3/libopencm3/pull/1243

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
 (Merged old and new into two new examples)
2020-11-28 22:13:25 +00:00
Matt Walker 1c54d58c81 STM32H7: Support the RNG Peripheral
The random number generator on the STM32H7 is identical to the v1 RNG
already present in the library. So use that, and make sure that the RCC
knows about the peripheral.

Originally filed at: https://github.com/libopencm3/libopencm3/pull/1244

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
 * whitespace changes from review
2020-11-28 22:13:25 +00:00
tute-avalos b47d769369 stm32: uart: Add Trasmission Complete enable/disable interrupt functions 2020-11-28 22:13:25 +00:00
Caleb Szalacinski 174d3400dd Update checkpatch.pl with changes to the Linux Kernel Coding Style
The Linux kernel just deprecated the 80 character line limit.
This was always a mild issue of mine because of operations on lengthily-named registers that go just over the 80 character limit.
https://www.phoronix.com/scan.php?page=news_item&px=Linux-Kernel-Deprecates-80-Col
2020-11-28 22:13:25 +00:00
Matthew Lai c49b4d35c2 stm32f7: added USB OTG FS/HS
Originally tracked at https://github.com/libopencm3/libopencm3/pull/958
While it doesn't work for everyone, this is clearly the basic first
steps required for any progress to be made.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2020-11-28 22:13:25 +00:00
BOJIT 5d393b17a3 ethernet: stm32: PTP naming fixes.
Verify all hardware differences between F1 and F4/F7 Ethernet hardware.
Flags registers missing on F1 as well.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2020-11-28 22:13:25 +00:00
Lars Kruse 5968b8a856 Update python references to python3
Python2 is end-of-life [1] since the 1st of January 2020.

Some distributions (most notably: Debian and its derivatives) will stop
providing a `python` executable in order to encourage users to specify
the interpreter language of local scripts explicitly.  Users of such
environments will be forced to work around this in one of these ways:

* create a virtual environment or
* manipulate the shebangs of the scripts or
* install the python2 package (as long as it is provided by distributions)

All currently maintained distribution releases provide python3.
In the near future distributions will need to remove python2, since it
is not maintained anymore.

PEP-394 [2] recommends to reference a specific python version
(python2 or python3), if the script is not expected to run in a virtual
environment.

Closes: #1265

[1] https://www.python.org/dev/peps/pep-0373/#update-april-2014
[2] https://www.python.org/dev/peps/pep-0394/#for-python-script-publishers

Amended-by: Karl Palsson <karlp@tweak.net.au>
* moved lpc43xx scripts to explicitly call python2, they have not been
  ported, and are effectively unmaintained, but switching them to
  python3 unconditionally would be unhelpful.
2020-11-28 22:13:25 +00:00
Karl Palsson 4eee1e9bde stm32f1: rcc: mark old style static routines deprecated 2020-11-28 22:13:25 +00:00
Karl Palsson a9608c524f tests: stm32f1: use new clock struct routines 2020-11-28 22:13:25 +00:00
Karl Palsson 5f051241a8 stm32f1: rcc: provide struct based clock helpers
As on every other family.

Fixes: https://github.com/libopencm3/libopencm3/issues/1172
2020-11-28 22:13:25 +00:00
Karl Palsson a7902aa4d0 stm32l1: rcc/lcd: fix RTCSEL HSE definition
Wrong since original commit in 2013.

LCD code can't actually automatically determine clock speed if it's HSE,
as we don't know here whether what HSE is, nor what it's divided by.
For more fun, that old 2014 API doesn't have any way of flagging that it
failed either.  Hooray.
2020-11-28 22:13:25 +00:00
Devan Lai c13c2b3b3c usb: Allow registration of a single non-contiguous string descriptor for WinUSB
Classic WinUSB support is detected by probing for a string descriptor
at index 0xEE with a special string.
usbd_register_extra_string() allows registration of a string at this
index without having to provide 237 other string descriptors

Originally filed as https://github.com/libopencm3/libopencm3/pull/849

WCID reference: https://github.com/pbatard/libwdi/wiki/WCID-Devices
2020-11-28 22:13:25 +00:00
Manuel Bl ffe8ddfca2 stm32l4: Use USB_OTG_FS_BASE instead of OTG_FS_BASE
Use the standard definition name, so that all standard shared code for
this peripheral works.

Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2020-11-28 22:13:25 +00:00
Manuel Bl e9c94760e6 stm32l4: enable USB OTG driver 2020-11-28 22:13:25 +00:00
Karl Palsson 76c0a8c289 stm32: rcc: convert to use new standard defines 2020-11-28 22:13:25 +00:00
Karl Palsson c7d7a18dd7 stm32: rcc: Standardize prescaler define names
We did have
* _HPRE_SYSCLK_DIVN (3 parts)
* _HPRE_DIVN (5 parts)
* _HPRE_DIV_N (4 parts)

Unify all on _HPRE_DIVN.  Provide deprecated definitions to not break
everything at once.

Also, standardize on "NODIV" instead of DIVNONE.
2020-11-28 22:13:25 +00:00
Karl Palsson 43b3fa5ddc stm32l0/l1: flash: support half page flashing
Tested on L1 and L0 using the "dapboot" project, see
https://github.com/devanlai/dapboot/pull/27 for L1
and
https://github.com/devanlai/dapboot/pull/30 for L0
2020-11-28 22:13:25 +00:00
Karl Palsson b88196f807 ld: support ".ramtext" section hook to place functions in ram
We already had the hooks for ccmram and ram1 and ram2 and ram3 and xsram
for "other" ram sections, but there was no method, out of the box, for
placing a function in "normal" ram.  The "easy" method of labelling a
function as ".data.someramfunc" causes warnings because code isn't meant
to have a name like ".data*" so we must explicitly add a new code
section.

Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2020-11-28 22:13:25 +00:00
Karl Palsson 54319107b0 ld: support ".noinit*" uninitialized ram section
Add support for a section(s) ".noinit*" that will be allocated in ram,
but not cleared or initialized.  This can be used for passing variables
between a bootloader and an app for instance, or even just between
restarts of your application.

Without any assigned usages of the section, there is zero change in ram
usage.  The align does nothing when the prior section was already
aligned.
2020-11-28 22:13:25 +00:00
Karl Palsson 1acfa1c917 stm32l1: desig: handle flash size footnotes from refman
Some of the chipid variants have some footnotes on reading the flash
size register, make sure we report things nicely.
2020-11-28 22:13:25 +00:00
Karl Palsson 636918732d stm32: i2c: drop useless integer defines I2C_CR2_FREQ_
These defines were simply a word containing the number, instead of the
number itself.  This provides no value, and implies that there's a
limited set of values.  The list was _already_ incomplete, so
misleading, _and_ just noise to maintain.  Burn it all.

(well, burn it just a little bit, provide deprecated aliases on the old
values so that code keeps compiling)
2020-11-28 22:13:25 +00:00
Karl Palsson e15071dbf8 BREAKING: drop all part specific ld files
We were never going to be capable of supporting every single part
variant with their own files, so stop trying.  We've been supporting the
linker script generator for a long time now, so move on from these old
static files.

Breaking: if you were using one of these, and don't wish to use the
linker script generator, you should simply declare a stub linker script,
and include the generic section definitions file, and provide this in
your own application.

Old:
LDSCRIPT = $(OPENCM3_DIR)/lib/stm32/l1/stm32l15xxb.ld

New (linker script generator):

DEVICE=stm32l151cb

New (manual):

* Add file mymemorymap.ld, with contents similar too:
```
MEMORY
{
       rom (rx) : ORIGIN = 0x08000000, LENGTH = 256K
       ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K
}

/* Include the common ld script. */
INCLUDE cortex-m-generic.ld
```

LDSCRIPT=mymemorymap.ld

See ld/README for more information on using the linker script generator
2020-11-28 22:13:25 +00:00
Karl Palsson fd3c950b29 tests: gadget0: switch to Linker script generation
We're about to drop the very limited set of fixed linker scripts we
have, so convert all the in tree code to linker script generation
2020-11-28 22:13:25 +00:00
Karl Palsson 9ae81c798a README: description of website 2020-11-28 22:13:11 +00:00
Karl Palsson 33c0a1d914 README: explain versioning goals 2020-11-28 22:13:03 +00:00
Dima Barsky 08c5f2a1fb stm32: i2c-v1: Fixed a typo in i2c_read7_v1 and i2c_write7_v1
Replaced & with &&
Wait for all three bits to be set - SB, MSL, and BUSY.

Old code worked by chance, use booleans to correctly convey intent.
Reviewed-by: Karl Palsson <karlp@tweak.net.au>
2020-10-16 12:00:20 +00:00
Karl Palsson 946c1cbc48 jenkins: try no parallelism
clutching at straws to try and eliminate incomprehensible build failures
:(
2020-10-11 13:02:43 +00:00
Fabio Pugliese Ornellas d60d7802fd Make GENHDR build faster 2020-10-07 22:02:39 +00:00
Diego Herranz d7ec88c4ea Small README changes
- Use libopencm3-template instead of libopencm3-examples as reference
on how to include libopencm3 to your project.
- Sourceforge website removed since it's only used for the mailing lists
which are listed immediately above.
- Small fixes
2020-10-07 22:00:10 +00:00
Karl Palsson 5dc9dfac79 stm32h7: add dispatch for enabling FPU
Fixes: https://github.com/libopencm3/libopencm3/issues/1217
2020-10-07 21:41:53 +00:00
Karl Palsson 5617ed4664 jenkins: reduce parallel, add verbose
V=s is openwrt, V=1 is here.
try and avoid weird problems with missing files like,
make[1]: *** No rule to make target '../../../include/libopencm3/stm32/g4/pwr.h', needed by 'rcc_common_all.o'.  Stop.

by turning down the paralellism a bit, it's a quad core arm, but it's
stil a little small machine.
2020-09-27 13:47:08 +00:00
Karl Palsson 10b63667b5 jenkins: publish github status always first
need a result first, before we (potentially fail) to publish tests
2020-09-27 13:44:38 +00:00
Karl Palsson b8461da137 jenkins: attempt to mark commit status only within libopencm3
trying to get pr checks tto flag properly
2020-09-27 13:34:37 +00:00
Karl Palsson 09bf6e9ebc jenkins: fix typo 2020-09-26 21:48:51 +00:00
Karl Palsson 11d2408289 jenkins: try and set commit status on correct commit
Logs on jenkins showed it trying to set the commit state on the wrong
commits, the master of upstream, instead of the head of the PR
2020-09-26 21:41:12 +00:00
Karl Palsson 52dc1ff6d7 Update jenkinsfile after testing by edits live on jenkins 2020-09-10 21:19:55 +00:00
Karl Palsson 04dd4c6fc8 try out other ways.. 2020-09-10 21:19:55 +00:00
Karl Palsson 3416f55ee9 jenkins hatr 2020-09-10 21:19:55 +00:00