1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00

1451 Commits

Author SHA1 Message Date
James Snyder
c216dd2396 stm32f4: notify usb host of device startup 2014-06-18 11:38:28 -05:00
Martin Guy
30ee5de1f9 Add check for console on USB serial port but USB CDC not enabled.
Before this, you could put the console on USB CDC without BUILD_USB_CDC
and eLua compiled OK but nothing worked. This change makes it spit out
an appropriate message if that should happen again.
2014-05-16 14:36:59 +02:00
Martin Guy
80dbce93eb Fix Mizar32 default IP from 193.168.1.10 to 192.168.1.10
A typo in the new build system config files set IP to 193.* with gateway
192.* which can never work.
2014-05-16 14:28:39 +02:00
James Snyder
382a49c749 Merge pull request #50 from ecdr/MiscUpdates
LM3S - correct cpu in ek-lm3s6965 board file, ethernet functions, enable cdc in board files
2014-05-11 15:44:13 -05:00
ecdr
030fd9e7f5 enable cdc on mizar32a, b and soldercore (had uart=cdc, but cdc not built) 2014-05-10 12:28:19 -07:00
Bogdan Marinescu
595078219e Merge pull request #51 from smartavionics/mb-stm32f4-tck-pulldown
STM32F4 - TCK/SWDCLK should be pulled down, not up.
2014-05-07 20:28:32 +01:00
Mark Burton
3a56fd7822 STM32F4 - TCK/SWDCLK should be pulled down, not up. 2014-05-06 08:29:16 +01:00
ecdr
1202076a3e STM32 - #elseif -> #elif 2014-05-04 16:44:33 -07:00
James Snyder
069510c324 handle zero element size for bitarray 2014-04-22 14:50:34 -05:00
James Snyder
03b2ff1ad6 remove unnecessary signed comparisons with unsigned type 2014-04-22 14:45:49 -05:00
James Snyder
62589e467f check that INT_TMR_MATCH is not set to invalid interrupt 2014-04-22 11:28:29 -05:00
James Snyder
02a128b34b remove unused variable from bit library 2014-04-17 19:16:56 -05:00
James Snyder
5c0f204775 Make sure we actually get a file descriptor before creating new WOFS file 2014-04-17 12:54:18 -05:00
James Snyder
fc8f3e4a3d prevent calling tmr_int_handler with negative numbers since id indexes into an array 2014-04-17 12:29:12 -05:00
James Snyder
edbe57047f missing return on stm32[f4] enc handler set functions 2014-04-17 12:18:23 -05:00
ecdr
fb1a3b1cc8 LM3S - ek-lm3s6965.lua - fix cpu, was lm3s8962 rather than lm3s6965 2014-04-16 21:47:43 -07:00
ecdr
0faa1a6bbc LM3S - ethernet - make platform net functions use their arguments
rather than assuming they are dealing with uip_buf
2014-04-16 21:43:40 -07:00
ecdr
be21b8db53 uip-conf.h (various platforms) - note inconsistency -
comment says UIP_CONF_UDP_CHECKSUMS should be 0, but it is 1
so which is right?  (comment or code)
2014-04-16 21:43:39 -07:00
ecdr
a0a54c23df STM32F4 - uip-conf.h - replace with identical file with less restrictive copyright 2014-04-16 21:43:39 -07:00
ecdr
ecdb92070a pio.c - remove redundant include (lualib.h includes lua.h) 2014-04-16 21:43:38 -07:00
James Snyder
8405e9bbbb Make LuaRPC funcname long enough for null termination 2014-04-15 10:59:44 -05:00
James Snyder
06dd9a295d Fix missing element in external ints for stm32
- stm32, stm32f2 & stm32f4 were missing EXTI_Line11 in external
  interrupts source list, causing out of bounds & interrupt source
  identification
2014-04-15 10:42:25 -05:00
James Snyder
9f9577a321 Don't optimize numbers for compressed romfs on integer builds
- luasrcdiet uses 'e' notation which doesn't work in integer builds
2014-04-14 15:14:19 -05:00
James Snyder
c67dd89237 Merge pull request #49 from smartavionics/mb-stm32f4-timer-mods
Mb stm32f4 timer mods
2014-04-06 13:51:37 -05:00
Mark Burton
55dd1f908c Keep the timer running when stopping timer generated cyclic interrupts.
For some reason (unknown to me) platform_s_timer_set_match_int() was clearing
the timer's CR1 and CR2 regs when the interrupts are to be stopped. This
had the effect of stopping the timer completely so a delay() on that timer
would hang forever. Now the timer keeps running and can be used normally
after the interrupts have been stopped.
2014-04-06 12:13:33 +01:00
Mark Burton
d55c74be67 In platform_s_timer_delay() don't assume timer reload value is all ones.
If the timer has been used to clock ADC or PWM or to generate interrupts
the reload value is unlikely to be all ones. The reload value will be
all ones if the timer has just been used as an elua timer.

So, when the timer wraps use the real reload value which is in ARR rather
than assuming it is 0xFFFF or 0xFFFFFFFF.
2014-04-06 12:09:21 +01:00
Mark Burton
324b0e7db8 Fix platform_s_timer_delay() so it doesn't hang when specified delay is too large.
Previously, if the specified delay resulted in a final value that
was wider than the timer width, the code would loop forever because the
timer counter would never reach the value of final.

Now, it checks to see if the timer has wrapped and, if so, reduces the value
of final by the timer's max count value.

An added benefit is that now all timers can delay for up to the maximum
delay handled by the target whereas previously the maximum delay was limited
by the width of the counter.
2014-04-06 09:21:59 +01:00
Mark Burton
d37f0e3331 Add support for 32 bit timers TIM2 and TIM5 (id 1 and 4).
These timers now handle 32 bit counts & delays.
2014-04-06 09:14:10 +01:00
Bogdan Marinescu
f20e817ee8 Merge pull request #47 from smartavionics/stm32f4-nucleo
Stm32f4 nucleo
2014-03-25 20:21:01 +00:00
Bogdan Marinescu
943189bb26 Merge pull request #45 from ecdr/MiscUpdates
Misc updates
2014-03-25 20:20:35 +00:00
Bogdan Marinescu
c0e9b8bf97 Merge pull request #41 from smartavionics/mb-stm32f4-cpu-additions
Add getclksfreq(), wfe(), wfi(), rnd.setup() and rnd.read() functions.
2014-03-25 20:18:28 +00:00
Mark Burton
baa5d9c76d Rework configuration of STM32F4 HSI clock.
Now, to use the HSI clock, specify an internal clock frequency in the
"clocks" config section, like this...

clocks = { internal = 16000000, cpu = 84000000 }

Don't specify an external frequency as well as the internal frequency.
2014-03-20 18:31:48 +00:00
Mark Burton
e2121e72fa Now determines the required flash latency from the system clock frequency.
This assumes that the MCU supply voltage is at least 2.7V.
2014-03-20 18:18:21 +00:00
Mark Burton
1611fab94b Can't use HSE clock on the Nucleo board as it's not populated.
The board as supplied does not provide any external clock to the F4.
It could supply an 8MHz clock from the STLINK part but, by default, it
isn't configured to do that.

So just use the HSI instead of the HSE - it won't be good for USB or fast
CAN bit rates but should be fine for bit banging, etc.
2014-03-20 16:46:02 +00:00
Mark Burton
7b790be60d Reduce the flash latency to 2WS as that is sufficient for the 84MHz clock. 2014-03-20 16:38:32 +00:00
ecdr
593044af24 LM3S - platform.c - remove duplicate include 2014-03-19 21:48:59 -08:00
ecdr
025dabfc6a LM3S - platform.c - MAP_ - Use ROM versions of library if available 2014-03-19 21:48:58 -08:00
ecdr
02fa7beac4 LM3S - platform_int - use platform_pio_get_num_pins rather than assuming 8 pins per port 2014-03-19 21:48:58 -08:00
ecdr
307de046e2 LM3S - startup_gcc - use console UART, rather than assuming UART0 2014-03-19 21:48:57 -08:00
ecdr
cb849d0d46 LM3S - startup_gcc.c - human readable error messages for default ISRs
also, use ROM versions of UARTCharPut, if available
2014-03-19 21:48:57 -08:00
ecdr
7dc3b36b52 platform.h - note unused constants
PLATFORM_SPI_TOTAL, PLATFORM_UART_TOTAL, PLATFORM_PWM_TOTAL

TODO: Figure out purpose, or remove them
2014-03-19 21:48:56 -08:00
ecdr
1019acf756 elua i2c module - fix comment 2014-03-19 21:48:56 -08:00
ecdr
dd5053fb29 eLua - comments - include return from functions in can, i2c 2014-03-19 21:48:55 -08:00
ecdr
c4493d48a4 DOC - CAN - fix typo 2014-03-19 21:48:55 -08:00
Bogdan Marinescu
ea93180b5b Merge pull request #44 from smartavionics/stm32f4-nucleo
Ported to STM32F401 Nucleo board.
2014-03-19 12:46:37 +00:00
Mark Burton
8c6757e856 Ported to STM32F401 Nucleo board.
The Nucleo boards are like the Discovery boards in that they come with an
attached STLINK-V2 programmer. The MCU's UART2 is routed through the
programmer's USB connection and it appears as a VCP device on the host.

So far, this has only been tested to the extent that the elua shell and
lua prompt appear to be functioning as expected.
2014-03-19 12:10:45 +00:00
James Snyder
044f861a90 Merge pull request #43 from smartavionics/mb-misc-mods
Fixes for a compilation problem and a race in the system timer code.
2014-02-24 19:00:40 -06:00
Mark Burton
4cfaeebe1d Add functions to read STM32F4 MCU id and unique device id.
stm32f4.cpu.read_mcu_device_id() returns a number containing the 32 bit id.

stm32f4.cpu.read_unique_device_id() returns an array of 3 numbers. The first
number contains bits 0-31, the second number contains bits 32-63 and the
last number contains bits 64-95 of the unique device id.
2014-02-24 17:30:36 +00:00
Mark Burton
aa7c774f1e Merge branch 'master' into mb-stm32f4-cpu-additions 2014-02-24 17:20:01 +00:00
Mark Burton
e9f23cc33f Reorder assignments in cmn_systimer_get() to avoid race.
Before, it was possible for the system timer counter to wrap from high to low
after its value had been read but before the value of cmn_systimer_counter
was read and so the resulting sum of those values would be too large.

By reordering the assignments, we can now detect if cmn_systimer_counter has
been advanced while reading the system timer counter value and, if so, repeat
the assignments to ensure consistent values.
2014-02-23 18:07:06 +00:00