Skip to content

Commit

Permalink
fix: handle stack too small issue on nanoX
Browse files Browse the repository at this point in the history
  • Loading branch information
keiff3r committed Aug 9, 2024
1 parent 55cfcd9 commit bb583ab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ APP_LOAD_PARAMS = --curve secp256k1 $(COMMON_LOAD_PARAMS) --path $(APPPATH)
ENABLE_PENDING_REVIEW_SCREEN ?= 1

include $(CURDIR)/../deps/ledger-zxlib/makefiles/Makefile.devices

ifeq ($(TARGET_NAME),TARGET_NANOS)
APP_STACK_MIN_SIZE := 1600
else ifeq ($(TARGET_NAME),TARGET_NANOX)
# the previous value (5000) was too high and caused the app to crash, i reduced it until it worked
APP_STACK_MIN_SIZE := 1730
endif

$(info TARGET_NAME = [$(TARGET_NAME)])
$(info ICONNAME = [$(ICONNAME)])

Expand Down
6 changes: 4 additions & 2 deletions app/src/common/tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@
#include <string.h>
#include "zxmacros.h"

#if defined(TARGET_NANOX) || defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX)
#if defined(TARGET_NANOS2) || defined(TARGET_STAX) || defined(TARGET_FLEX)
#define RAM_BUFFER_SIZE 8192
#define FLASH_BUFFER_SIZE 16384
#elif defined(TARGET_NANOX)
#define RAM_BUFFER_SIZE 8158
#define FLASH_BUFFER_SIZE 16384
#elif defined(TARGET_NANOS)
#define RAM_BUFFER_SIZE 256
#define FLASH_BUFFER_SIZE 8192
#endif

// Ram
uint8_t ram_buffer[RAM_BUFFER_SIZE];

Expand Down

0 comments on commit bb583ab

Please sign in to comment.