Skip to content

Commit 1a28423

Browse files
author
Clément Léger
committed
Merge branch 'master' of github.com:clementleger/cypress_linux_tools
Conflicts: make/Makefile.cypress
2 parents beff18a + 34f8a3c commit 1a28423

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# DISCLAIMER
33

44
This work is absolutely **not related** to cypress in any way.
5+
I am not to be liable for direct, indirect or consequential damages of your devices.
56

67
## Introduction
78

@@ -13,7 +14,7 @@ It has only been successfully tested with a CY8CKIT-049 42xx kit.
1314
The prerequisites are the following:
1415
- `gengetopt`
1516
- `make`
16-
- `wine` (to run cyelftool when using makefile)
17+
- `wine` (to run `cyelftool` when using makefile)
1718
- An arm toolchain (arm-none-eabi-)
1819

1920
In order to build and install these utilities:
@@ -51,7 +52,7 @@ To build it, the `make` command should be sufficient.
5152

5253
Thanks from https://github.com/gv1/hex2cyacd, the format is well explained and it was possible to write a C tool.
5354
ihex2cyacd is a an utility to create cyacd files from ihex files.
54-
In order to use it, the simplest way is to use it
55+
Using the Makefile.cypress will hide the usage.
5556

5657
### Usage
5758

@@ -70,6 +71,7 @@ In order to use it, the simplest way is to use it
7071

7172
A Makefile.cypress file is available in the repository in order to easily compile cydsn projects.
7273
Two variable are required to be set which are PSOC_CREATOR_DIR and PROJECT_DIR.
74+
Additionnally, An ARM toolchain is necessary. Code Sourcery ones are sufficient.
7375
The easiest way to use it is to create a Makefile with the following content
7476

7577
```
@@ -79,6 +81,7 @@ PROJECT_DIR := Path_to_project.cydsn
7981
include Makefile.cypress
8082
8183
```
84+
`cyelftool` is still used though wine (not reversed yet).
8285

8386
Then type `make` to compile the application.
8487
Note that some old generated files may be outdated and can't compile.
@@ -92,4 +95,4 @@ The final cyacd file can be flashed using `cyhostboot`.
9295
## Notes
9396

9497
The `cyelftool` cypress utility has not yet been reversed.
95-
However thanks to wine, this utility can be used and
98+
However thanks to wine, this utility can be used under Linux.

make/Makefile.cypress

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11

22
# Add a entry here to define a new platform
3-
CY8C42_flash_size := 32768
4-
CY8C42_flash_array_size := 32768
5-
CY8C42_flash_row_size := 128
6-
CY8C42_mcpu := cortex-m0
7-
CY8C42_cpu_dir := CortexM0
8-
CY8C42_bootloader_size := 4296
3+
CY8C49_flash_size := 32768
4+
CY8C49_flash_array_size := 32768
5+
CY8C49_flash_row_size := 128
6+
CY8C49_mcpu := cortex-m0
7+
CY8C49_cpu_dir := CortexM0
8+
CY8C49_bootloader_size := 4296
9+
CY8C49_psoc_type := PSoC4
910

1011
PROJECT_DIR ?= $(error PROJECT_DIR must be defined)
1112
PROJECT_NAME = $(basename $(notdir $(PROJECT_DIR)))
1213
PSOC_CREATOR_DIR ?= $(error PSOC_CREATOR_DIR must be defined)
1314
CROSS_COMPILE := arm-none-eabi-
14-
CPU_TYPE ?= CY8C42
15-
PSOC_TYPE ?= PSoC4
15+
CPU_TYPE ?= CY8C49
1616

1717
# Special dir from cypress tools
1818
CYCOMPONENT_LIB := $(PSOC_CREATOR_DIR)/psoc/content/CyComponentLibrary/CyComponentLibrary.cylib/$($(CPU_TYPE)_cpu_dir)/ARM_GCC_493/Debug/CyComponentLibrary.a
1919
CYELFTOOL := $(PSOC_CREATOR_DIR)/bin/cyelftool.exe
2020

21-
# Upload stuff
21+
BUILD_DIR ?= ./build
2222
UPLOAD_BAUDRATE ?= 115200
2323
SERIAL_PORT ?= /dev/ttyACM0
24-
25-
# Directory
26-
GEN_SRC_DIR := Generated_Source/$(PSOC_TYPE)/
27-
BUILD_DIR ?= ./build
24+
25+
GEN_SRC_DIR := Generated_Source/$($(CPU_TYPE)_psoc_type)/
2826

2927
COMMON_FLAGS := -mcpu=$($(CPU_TYPE)_mcpu) -mthumb
3028

@@ -33,6 +31,8 @@ LFLAGS := -Wl,--gc-sections -Wl,-Map,$(BUILD_DIR)/$(PROJECT_NAME).map -L$(BUILD
3331
ASFLAGS := $(COMMON_FLAGS)
3432
INCLUDE_CFLAGS := -I$(PROJECT_DIR)/$(GEN_SRC_DIR) -I$(PROJECT_DIR)/
3533

34+
35+
3636
SRC_C_FILES := $(wildcard $(PROJECT_DIR)/$(GEN_SRC_DIR)/*.c $(PROJECT_DIR)/*.c)
3737
BOOTASM_GNU := $(PROJECT_DIR)/$(GEN_SRC_DIR)/CyBootAsmGnu.s
3838

0 commit comments

Comments
 (0)