Commit Graph

18 Commits

Author SHA1 Message Date
Vic Yang
d0d6befc3f Add stm32mon support for STM32F37xx
This is needed for the new Ryu boards.

BRANCH=none
BUG=chrome-os-partner:32660
TEST=Program STM32F373 chip.

Change-Id: Ib7a58826945090300b7e086e888c43c46fb499ab
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/223893
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2014-10-21 00:44:29 +00:00
Vincent Palatin
1ec56e8546 stm32mon: add option to read firmware image from stdin
Add a command-line option to ask stm32mon to read the EC firmware image
to flash from the standard input when the filename is replaced by a "-".

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=chromium:398165 chromium:396233
TEST=use the following flashing commands:
cat build/fruitpie/ec.bin | ./util/flash_ec --board=fruitpie --image=-
./util/flash_ec --board=fruitpie
./util/flash_ec --board=fruitpie --image=build/fruitpie/ec.RO.flat
and check the content of the flash.

Change-Id: I8039ecb6910f912161a7f59c5f5e2fc80447ce7b
Reviewed-on: https://chromium-review.googlesource.com/220842
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
2014-10-02 07:02:54 +00:00
Gwendal Grignou
41fdea92b5 stm32mon: add support for i2c transport.
BUG=chromium:405601
TEST=Able to read/erase/write flash on Ryu. Able to send go command.
BRANCH=ToT

Change-Id: I588cfee3dbbb3d8e3b66fe9d1044f3612f9b02c3
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/214032
Reviewed-by: Vic Yang <victoryang@chromium.org>
2014-09-04 15:47:49 +00:00
zyw
054c9fe6a6 veyron: Modify board config
This patch is base on new hardware board, veyron has not some stuff,
such as power led, charge en

BUG=None
TEST=Read log with servo board, it has reponse when type some commends
BRANCH=None

Change-Id: I45502fd1278f69db5e46fc9ab1deaee02fc8708f
Signed-off-by: zyw <zyw@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/209231
Reviewed-by: Alexandru Stan <amstan@google.com>
Commit-Queue: Alexandru Stan <amstan@google.com>
Tested-by: Alexandru Stan <amstan@google.com>
2014-07-23 02:30:10 +00:00
Vincent Palatin
39588b067f stm32mon: fix STM32F03x flash size
The current SKU has 32kB.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=none
TEST=read-back the flash content from a Zinger power brick using
"stm32mon -r".

Change-Id: Id74e585f4b49b9ef5fecdec8182f3710eb0b4960
Reviewed-on: https://chromium-review.googlesource.com/196690
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
2014-04-30 09:45:59 +00:00
Vincent Palatin
7a7c92e15e stm32: add STM32F03x configuration
Add STM32F03x as part of the STM32F0 family.
STM32F031 will be used for devices requiring low-end parts.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=none
TEST=along with the following CLs, run on STM32F051 Discovery with
limited RAM and Flash to mimic STM32F031.

Change-Id: Ie95303eaf00ce53fe7c8d2ac84c19a983aadbf0d
Reviewed-on: https://chromium-review.googlesource.com/189404
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
2014-03-22 06:24:19 +00:00
Vincent Palatin
39327cc4cd stm32: add support for STM32F0xx family
Add support for the STM32F0xx family of devices using a Cortex-M0 core
and slightly newer peripherals than F1xx family.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=none
TEST=run EC console on STM32F072B Discovery board.
and pass all available unit-tests on target.

Change-Id: Idaa3fcbf1c0da8a8f448c0e88e58bfd976b0a735
Reviewed-on: https://chromium-review.googlesource.com/188983
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
2014-03-11 05:52:44 +00:00
Randall Spangler
6ab8e91658 cleanup: Remove checkpatch warnings
This make minor syntactic changes and renames some camel-cased symbols
to keep checkpatch from complaining.  The goal is to reduce the
temptation to use 'repo upload --no-verify'.

This is a big furball of find/replace, but no functional changes.

BUG=chromium:322144
BRANCH=none
TEST=build all boards; pass unit tests

Change-Id: I0269b7dd95836ef9a6e33f88c003ab0f24f842a0
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/180495
2013-12-19 00:12:28 +00:00
Jeremy Thorpe
734916edfd Tool support for STM32L-Discovery board
Add the ChipID for the stm32l152c board to stm32mon.  Add discovery to the list
of supported boards in flash_ec.

BUG=None
TEST=With modified servo connector, see that image can be loaded onto
stm32l152c discovery board.
BRANCH=none

Change-Id: Ie16c64d17c907f7de765b09de98f534c486ae04c
Signed-off-by: Jeremy Thorpe <jeremyt@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/170981
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-09-28 04:21:21 +00:00
Vincent Palatin
fe2e8852b9 stm32mon: add back flashing progression
As we no longer have the low-tech dots to show the progression of the
on-going flashing, display a completion percentage to give the user a
hint of the ETA.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=none
TEST=./util/flash_ec --board=spring
and see accurate progression percentage reported.

Change-Id: I75ccbe3433acd6c94d03a08bf462ea4516e4ce02
Reviewed-on: https://gerrit.chromium.org/gerrit/42733
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2013-02-06 10:35:52 -08:00
Vadim Bendebury
c817977583 Modify stm32mon to better suite autotest use
This change introduces the following modifications:

When used outside chroot on Goobuntu the serial interface fails to initialize
if parity enable bit is set (for a reason not clearly understood). On top of
that the tcsetattr() return value of zero is not a guarantee of success. To be
sure that the settings came through one is supposed to read back the driver
config and compare it with the desired config.

To add insult to injury, gPrecise driver rejects attempts to enable parity.
Parity setting is not essential in many cases, this is why we check the actual
config and if the only missing setting is parity we print a warning message
and continue.

In case an operation fails, the exit value should reflect that (so
that the autotest suite using the utility could report failure).

Often when the programming attempt is undertaken soon after reset,
this utility gets overwhelmed with the console output generated by the
EC on resets. Consume the output before proceeding.

Instead of printing a long set of dots (one per written/read block),
print a spinning wheel instead.

BRANCH=None
BUG=chrome-os-partner:15610
TEST=manual

   . used the utility to program Snow EC both inside and outside
     chroot, it succeeded.

    Observed the failing attempt to set parity when running outside
    chroot.

    Observed spinning characters instead of stream of dots.

Change-Id: Id25595d35a2a3ca578639cebd508f599e618787c
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42310
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-02-05 11:00:07 -08:00
David Hendricks
6e29f8091d stm32mon: add ID for stm32f102r8
This adds a table entry for stm32f102r8.

BRANCH=none
BUG=none
TEST=ran flash_ec successfully on an stm32f102r8 (see notes below)

ChipID 0x410 : STM32F102R8
Bootloader v2.2, commands : 00 01 02 11 21 31 43 63 73 82 92
Flash erased.
Writing 65536 bytes at 0x08000000 ... (many more dots) ...Done.

Signed-off-by: David Hendricks <dhendrix@chromium.org>
Change-Id: I1f4af0413a4df2c09a1043bdc78a429b79c28533
Reviewed-on: https://gerrit.chromium.org/gerrit/42270
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2013-01-30 12:29:26 -08:00
Louis Yung-Chieh Lo
228259479a stm32mon supports read unprotection.
Details please refer to AN3155 document.

BUG=None
TEST=run on real machine.
% stm32mon -U
% stm32mon -u
% stm32mon -w new_image

Change-Id: I070e18a7cb112afe0ab0d0f0bd06cecc4eefb37e
Signed-off-by: Louis Yung-Chieh Lo <yjlou@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/27630
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
Commit-Ready: Yung-Chieh Lo <yjlou%chromium.org@gtempaccount.com>
2012-07-17 20:55:41 -07:00
David Hendricks
3a841ae872 stm32mon: set flash_size to 128KB for chip ID 0x420
This updates the flash_size to match 128KB parts. Unfortunately
there does not seem to be an easy way to differentiate between the
64KB and 128KB parts at runtime.

BUG=none
TEST=tested on Snow

Signed-off-by: David Hendricks <dhendrix@chromium.org>

Change-Id: Ie1ca6f6d04753e91d937f67dec193fcf5566251e
Reviewed-on: https://gerrit.chromium.org/gerrit/26188
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Ready: David Hendricks <dhendrix@chromium.org>
Tested-by: David Hendricks <dhendrix@chromium.org>
2012-06-26 19:02:00 -07:00
Vincent Palatin
c25c92ff5e stm32mon: more robust serial communication
- throw away all the incoming garbage after a NACK to be protect against
unexpected behavior on the embedded monitor.

- increase the command timeout :
 on STM32F100, I have measured up to 1.4s to execute the erase 64kB
 command. With the current 2s timeout, it was failing when you are
 unlucky (since it's using a integer second timestamp to measure the
 timeout).

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=None
TEST=with a Snow, flash the board using stm32mon -w ec.bin
from various states.

Change-Id: I260b3b1311eac9be7c43f835eeac68051befd24a
Reviewed-on: https://gerrit.chromium.org/gerrit/24314
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
2012-06-01 13:13:25 -07:00
Vincent Palatin
aa5397e484 stm32mon: complete support for stm32f100
- add the simple erase command
- fix the flash size

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=None
TEST=./build/snow/util/stm32mon -d /dev/pts/10 -w ec.bin

Change-Id: I9bdb0cf06759a04bd2bbef24d559eb67e4c0aa00
2012-05-22 15:53:54 +00:00
Vincent Palatin
050bd0b1d3 stm32l: workaround missing mass erase feature
The STM32L15xx monitor does not implement the mass erase,
so we need to use the page erase feature and loop.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=None
TEST=on Discovery, fill the flash with a pattern, then erase, write a
firmware image, read back the content of the flash, run the firmware.

Change-Id: Icf0e9812a5d491fea78472a0203ddbbc3e813b2f
2012-03-06 21:31:54 +00:00
Vincent Palatin
c74bd90fb0 stm32l: add a tool to flash the SoC using the serial monitor
When run with BOOT0=1 and BOOT1=0, the STM32L enters a system monitor
which allows flashing over the serial port (USART1 pins PA9 and PA10).
Implement commands to flash and run a program from a linux Host.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BUG=None
TEST=on a serial port connected to Discovery board pins PA9 and PA10,
run manually the various tools commands.

Change-Id: I42f95ed50a56d82d728989149b3e47210af9dc96
2012-02-06 20:05:33 +00:00