From eaaebf3291a12ff65ca5c7f16e0d486fbde10efa Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 23 Sep 2014 10:59:05 +0100 Subject: stmhal: Initialise stack pointer correctly. Stack is full descending and must be 8-byte aligned. It must start off pointing to just above the last byte of RAM. Previously, stack started pointed to last byte of RAM (eg 0x2001ffff) and so was not 8-byte aligned. This caused a bug in combination with alloca. This patch also updates some debug printing code. Addresses issue #872 (among many other undiscovered issues). --- py/objfun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'py/objfun.c') diff --git a/py/objfun.c b/py/objfun.c index 8c08ce78c..eb89a78a0 100644 --- a/py/objfun.c +++ b/py/objfun.c @@ -183,7 +183,7 @@ STATIC void dump_args(const mp_obj_t *a, int sz) { STATIC mp_obj_t fun_bc_call(mp_obj_t self_in, mp_uint_t n_args, mp_uint_t n_kw, const mp_obj_t *args) { MP_STACK_CHECK(); - DEBUG_printf("Input n_args: %d, n_kw: %d\n", n_args, n_kw); + DEBUG_printf("Input n_args: " UINT_FMT ", n_kw: " UINT_FMT "\n", n_args, n_kw); DEBUG_printf("Input pos args: "); dump_args(args, n_args); DEBUG_printf("Input kw args: "); -- cgit v1.2.3