Skip to content

Commit fea0eff

Browse files
committed
Fixed the error in port/quectel direct compilation
1 parent 93ac492 commit fea0eff

File tree

9 files changed

+23
-255
lines changed

9 files changed

+23
-255
lines changed

ports/quectel/Makefile

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ include ../../py/mkenv.mk
55
include mpconfigport.mk
66
include quectel.mk
77

8-
CROSS = 1
9-
10-
ifeq ($(CROSS), 1)
118
CFLAGS = $(INC) $(QUEC_MOD_CFLAGS) $(PLAT_CFLAGS) $(PLAT_DFLAGS) $(COPT)
12-
else
13-
LD = gcc
14-
CFLAGS = $(INC) -Wall -Werror -Wdouble-promotion -Wfloat-conversion -std=c99 $(COPT)
15-
LDFLAGS = -Wl,-Map=$@.map,--cref -Wl,--gc-sections
16-
endif
179

1810
CSUPEROPT = -Os # save some code space
1911

@@ -36,11 +28,8 @@ endif
3628
include $(TOP)/py/py.mk
3729
include $(TOP)/extmod/extmod.mk
3830

39-
ifeq ($(CROSS), 1)
4031
CROSS_COMPILE ?= arm-none-eabi-
41-
endif
4232

43-
GIT_SUBMODULES += lib/micropython-lib
4433

4534
INC += -I.
4635
INC += -I$(TOP)
@@ -103,11 +92,7 @@ SRC_QSTR += $(SRC_MOD) $(SRC_MOD_CXX) $(SHARED_SRC_C) $(EXTMOD_SRC_C)
10392
OBJ += $(PY_CORE_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
10493
OBJ += $(addprefix $(BUILD)/, $(SRC_CXX:.cpp=.o))
10594

106-
ifeq ($(CROSS), 1)
10795
all: $(BUILD)/firmware.a
108-
else
109-
all: $(BUILD)/firmware.elf
110-
endif
11196

11297
$(BUILD)/_frozen_mpy.c: frozentest.mpy $(BUILD)/genhdr/qstrdefs.generated.h
11398
$(ECHO) "MISC freezing bytecode"

ports/quectel/README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,8 @@ $ make submodules
8181
$ make
8282
```
8383

84-
This will produce a combined `firmware.a` image in the `build/`
85-
subdirectory(The compiled MicroPython library will be used by HeliosSDK to build a complete firmware package).
86-
87-
To flash the firmware, you need to fully build the entire firmware package through heliossdk.
84+
This will produce a combined `firmware.a` lib in the `build/`
85+
subdirectory directly.The compiled MicroPython library will be used by HeliosSDK to build a complete firmware package. Of course, you can also build the entire firmware directly using the following method.
8886

8987
*Check the usage of the helios compilation commands*
9088

@@ -107,16 +105,16 @@ These are common commands used in various situations:
107105
108106
*Compile the firmware*
109107

110-
Taking the EC200UEU_AB module as an example, type the following command in the command line and press "**Enter**":
108+
Taking the EG915UEC_AC module as an example, type the following command in the command line and press "**Enter**":
111109
```
112-
helios make services/micropython @EC200UEU_AB EC200UEUABR03A01M08
110+
helios make services/micropython @EG915UEC_AC EG915UECACR03A01M08
113111
```
114112

115113
- `helios`: Trigger the compilation process.
116114
- `make`: Compile the firmware.
117115
- `services/micropython`: Application entry address (relative to the SDK root directory, according to the requirements of the host system, the Win32 platform is \ and the Linux platform is /). It can be adjusted according to the specific location of MicroPython.
118-
- `@EC200UEU_AB`: Specify the target module model. You need to modify it according to your actual model.
119-
- `EC200UEUABR03A01M08`: Firmware version name, which can be omitted. You need to modify it according to your actual model.
116+
- `@EG915UEC_AC`: Specify the target module model. You need to modify it according to your actual model.
117+
- `EG915UECACR03A01M08`: Firmware version name, which can be omitted. You need to modify it according to your actual model.
120118

121119
*Check the compilation target*
122120

ports/quectel/mpconfigport.h

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <stdint.h>
22

3+
#include "mpconfigboard.h"
34

45
/****************************** user define ************************************/
56
// python grammar
@@ -132,18 +133,12 @@
132133

133134
// type definitions for the specific machine
134135

135-
//typedef intptr_t mp_int_t; // must be pointer size
136-
//typedef uintptr_t mp_uint_t; // must be pointer size
137-
//typedef long mp_off_t;
136+
typedef intptr_t mp_int_t; // must be pointer size
137+
typedef uintptr_t mp_uint_t; // must be pointer size
138+
typedef long mp_off_t;
138139
#define UINT_FMT "%lu"
139140
#define INT_FMT "%ld"
140141

141-
typedef int32_t mp_int_t; // must be pointer size
142-
typedef uint32_t mp_uint_t; // must be pointer size
143-
typedef long mp_off_t;
144-
//#define mp_type_fileio mp_type_vfs_lfs1_fileio
145-
//#define mp_type_textio mp_type_vfs_lfs1_textio
146-
147142

148143
#if MICROPY_ENABLE_GC
149144
#ifndef MICROPY_QPY_GC_HEAP_SIZE

ports/quectel/mpconfigport.h.bak

Lines changed: 0 additions & 211 deletions
This file was deleted.

ports/quectel/mphalport.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,22 +240,22 @@ mp_uint_t mp_hal_stdout_tx_strn(const char *str, size_t len)
240240
return len;
241241
}
242242

243-
uint32_t mp_hal_ticks_ms(void)
243+
mp_uint_t mp_hal_ticks_ms(void)
244244
{
245-
return (uint32_t)Helios_RTC_TicksToMs();
245+
return (mp_uint_t)Helios_RTC_TicksToMs();
246246
}
247247

248-
uint32_t mp_hal_ticks_us(void)
248+
mp_uint_t mp_hal_ticks_us(void)
249249
{
250-
return (uint32_t)Helios_RTC_TicksToUs();
250+
return (mp_uint_t)Helios_RTC_TicksToUs();
251251
}
252252

253253
uint64_t mp_hal_time_ns(void)
254254
{
255255
return 0;
256256
}
257257

258-
void mp_hal_delay_ms(uint32_t ms) {
258+
void mp_hal_delay_ms(mp_uint_t ms) {
259259
mp_uint_t dt = 0;
260260
mp_uint_t t0 = 0,t1 = 0;
261261
Helios_Thread_t taskid = 0;
@@ -293,8 +293,8 @@ void mp_hal_delay_ms(uint32_t ms) {
293293
}
294294
}
295295

296-
void mp_hal_delay_us(uint32_t us) {
297-
uint32_t ms = us / 1000;
296+
void mp_hal_delay_us(mp_uint_t us) {
297+
mp_uint_t ms = us / 1000;
298298
ms = ms ? ms : 1;
299299
mp_hal_delay_ms(ms);
300300
}

ports/quectel/mphalport.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ typedef struct Input_ListNode
4242

4343
void _add_list_node();
4444
void _delete_list_node();
45-
void mp_hal_delay_ms(uint32_t ms);
46-
void mp_hal_delay_us(uint32_t us);
47-
uint32_t mp_hal_ticks_ms(void);
48-
uint32_t mp_hal_ticks_us(void);
4945
mp_uint_t mp_hal_ticks_cpu(void);
5046

5147
void mp_mthread_sleep_deal_init(void);
@@ -58,7 +54,6 @@ int mp_hal_stdio_init(void);
5854

5955
int mp_hal_stdin_rx_chr(void);
6056

61-
void mp_hal_delay_ms(uint32_t ms);
6257
void mp_hal_port_open(uint8_t state);
6358

6459
void mp_hal_set_interrupt_char(int c);

ports/quectel/plat.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
ifeq ($(strip $(PLAT)),)
16+
export PLAT = Unisoc
17+
export BOARD = EG915UEC_AC
1518

19+
DFLAGS = PLAT_$(strip $(PLAT)) BOARD_$(strip $(BOARD)) BOARD=$(strip $(BOARD))
20+
endif
1621

ports/quectel/quectel.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include plat.mk
12

23
PLAT_DFLAGS = $(addprefix -D,$(DFLAGS))
34
PLAT_CFLAGS = $(QUEC_CFLAGS)

ports/quectel/tools/mpy-cross

16 KB
Binary file not shown.

0 commit comments

Comments
 (0)