From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pavel Machek Date: Mon, 6 Apr 2015 20:14:44 +0200 Subject: [U-Boot] printf("%d") breaks u-boot 2015.01+ In-Reply-To: <201504061659.55725.marex@denx.de> References: <1427752878-18426-1-git-send-email-dinguyen@opensource.altera.com> <20150406144009.GA23259@amd> <201504061659.55725.marex@denx.de> Message-ID: <20150406181444.GB23259@amd> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon 2015-04-06 16:59:55, Marek Vasut wrote: > On Monday, April 06, 2015 at 04:40:09 PM, Pavel Machek wrote: > > Hi! > > > > In u-boot 2015.04-rc, as soon as execution hits printf("%d"), it > > hangs. (Usually, that's after "DRAM: " message). > > printf("%d") expects an argument, so could it be that it touches > random piece of memory and thus hangs? It had an argument, sorry for confusion. I was actually doing this: the test with %s works, the one with %d kills it. I suspect too small stack...? Pavel int dram_init(void) { printf("dram init: print size\n"); - // printf("printf test: %x\n", 0x12345678); - // printf("dram_init... %x\n", PHYS_SDRAM_1_SIZE); - gd->ram_size = PHYS_SDRAM_1_SIZE /2; //get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE); + printf("printf test: %x\n", 0x12345678); + printf("dram_init... %x\n", PHYS_SDRAM_1_SIZE); + gd->ram_size = get_ram_size((long *)PHYS_SDRAM_1, PHYS_SDRAM_1_SIZE); printf("dram init: ram size set\n"); return 0; } @@ -108,6 +108,9 @@ int cpu_mmc_init(bd_t *bis) int print_cpuinfo(void) { puts("CPU: Altera SoCFPGA Platform\n"); + printf("printf test string: %s\n", "ahoj"); + printf("printf test: %d\n", 1234567); + printf("printf test: %x\n", 0x12345678); return 0; } -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html