Skip to content

Commit

Permalink
bootloader: Shrink size (primarily by disabling debug printk)
Browse files Browse the repository at this point in the history
  • Loading branch information
keirf committed Sep 23, 2019
1 parent f661196 commit 2c1dda0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ upd:

all:
$(MAKE) -C src -f $(ROOT)/Rules.mk $(PROJ).elf $(PROJ).bin $(PROJ).hex
bootloader=y $(MAKE) -C bootloader -f $(ROOT)/Rules.mk \
bootloader=y debug=n logfile=n $(MAKE) -C bootloader \
-f $(ROOT)/Rules.mk \
Bootloader.elf Bootloader.bin Bootloader.hex
logfile=n $(MAKE) -C bl_update -f $(ROOT)/Rules.mk \
BL_Update.elf BL_Update.bin BL_Update.hex
Expand Down
4 changes: 4 additions & 0 deletions src/fatfs/ffconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@
*/


#if defined(BOOTLOADER)
#define FF_FS_RPATH 0
#else
#define FF_FS_RPATH 1
#endif
/* This option configures support for relative path.
/
/ 0: Disable relative path and remove related functions.
Expand Down
2 changes: 2 additions & 0 deletions src/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,13 @@ void F_findnext(DIR *dp, FILINFO *fno)
handle_fr(fr);
}

#if !defined(BOOTLOADER)
void F_chdir(const TCHAR *path)
{
FRESULT fr = f_chdir(path);
handle_fr(fr);
}
#endif

/*
* Local variables:
Expand Down
9 changes: 4 additions & 5 deletions src/usb/stm32_usbh_msc/usb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ USB_OTG_STS USB_OTG_SelectCore(USB_OTG_CORE_HANDLE *pdev,
pdev->cfg.mps = USB_OTG_FS_MAX_PACKET_SIZE ;

/* initialize device cfg following its address */
#ifdef USB_OTG_FS_CORE
if (coreID == USB_OTG_FS_CORE_ID)
{
baseAddress = USB_OTG_FS_BASE_ADDR;
Expand All @@ -192,6 +193,8 @@ USB_OTG_STS USB_OTG_SelectCore(USB_OTG_CORE_HANDLE *pdev,
pdev->cfg.low_power = 1;
#endif
}
#endif /* USB_OTG_FS_CORE */
#ifdef USB_OTG_HS_CORE
else if (coreID == USB_OTG_HS_CORE_ID)
{
baseAddress = USB_OTG_HS_BASE_ADDR;
Expand Down Expand Up @@ -221,11 +224,7 @@ USB_OTG_STS USB_OTG_SelectCore(USB_OTG_CORE_HANDLE *pdev,
#endif

}

else
{
/* Do Nothing */
}
#endif /* USB_OTG_HS_CORE */

pdev->regs.GREGS = (USB_OTG_GREGS *)(baseAddress + \
USB_OTG_CORE_GLOBAL_REGS_OFFSET);
Expand Down

0 comments on commit 2c1dda0

Please sign in to comment.