From owner-freebsd-arm@FreeBSD.ORG Wed Sep 18 08:18:20 2013 Return-Path: Delivered-To: freebsd-arm@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id F2C73EB0 for ; Wed, 18 Sep 2013 08:18:19 +0000 (UTC) (envelope-from torfinn.ingolfsen@getmail.no) Received: from lamora.getmail.no (lamora.getmail.no [84.210.184.7]) by mx1.freebsd.org (Postfix) with ESMTP id 7B8222728 for ; Wed, 18 Sep 2013 08:18:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by lamora.getmail.no (Postfix) with ESMTP id C312E68192 for ; Wed, 18 Sep 2013 10:12:41 +0200 (CEST) X-Spam-Flag: NO X-Spam-Score: -2.95 X-Spam-Level: X-Spam-Status: No, score=-2.95 tagged_above=-10 required=6.6 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, T_FB_WORD2_END_DOLLAR=0.01, T_TVD_SUBJ_NUM_OBFU=0.01, T_TVD_SUBJ_NUM_OBFU2=0.01, T_TVD_SUBJ_NUM_OBFU3=0.01, T_UNKNOWN_ORIGIN=0.01] autolearn=ham Authentication-Results: lamora.get.c.bitbit.net (amavisd-new); dkim=pass (1024-bit key) header.d=getmail.no Received: from lamora.getmail.no ([127.0.0.1]) by localhost (lamora.get.c.bitbit.net [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id e7r7HBwGUS6D for ; Wed, 18 Sep 2013 10:12:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by lamora.getmail.no (Postfix) with ESMTP id 2CCB46CFAD for ; Wed, 18 Sep 2013 10:12:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.7.1 lamora.getmail.no 2CCB46CFAD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=getmail.no; s=8A9C8B4C-D727-11E2-8095-B6466E6B3FA2; t=1379491961; bh=e1OT3SlF/cUqZxCSZu1hFtiERmBGWLUCjrQpfOHUT2c=; h=Date:From:To:Subject:Message-Id:Mime-Version:Content-Type: Content-Transfer-Encoding; b=Mt82kv4ihZvunWD4vAFLJEQvbaGCPtoyXFzo3j/YA3yDkjW4P07xDYqXVgwDDTw+l M3MX8Ls8Ska9jgYiG25ruqp5Km1DbaQ+FOVelRpUdNbCNuGnLgeBf9Q30Ik/n6u5Tn Sh9MU2vfDDCSA3sAGdbDF4MEcU9j04H1e8/+enUY= X-Virus-Scanned: amavisd-new at Received: from lamora.getmail.no ([127.0.0.1]) by localhost (lamora.get.c.bitbit.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id WshTMf0QPtez for ; Wed, 18 Sep 2013 10:12:41 +0200 (CEST) Received: from kg-core1.kg4.no (cm-84.215.180.206.getinternet.no [84.215.180.206]) by lamora.getmail.no (Postfix) with ESMTPSA id 05A3F6BC5A for ; Wed, 18 Sep 2013 10:12:41 +0200 (CEST) Date: Wed, 18 Sep 2013 10:12:35 +0200 From: Torfinn Ingolfsen To: freebsd-arm@FreeBSD.org Subject: stm32flash under FreeBSD? Message-Id: <20130918101235.e1737d4bd839f71ebf554803@getmail.no> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.24.19; amd64-portbld-freebsd8.4) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2013 08:18:20 -0000 I compiled stm32flash[1] under FreeBSD 8.4-STABLE: tingo@kg-core1$ uname -a FreeBSD kg-core1.kg4.no 8.4-STABLE FreeBSD 8.4-STABLE #0 r253646: Thu Jul 25 10:12:31 UTC 2013 root@kg-core1.kg4.no:/usr/obj/usr/src/sys/GENERIC amd64 The resulting binary appears to work: tingo@kg-core1$ ./stm32flash stm32flash - http://stm32flash.googlecode.com/ ERROR: Device not specified Usage: ./stm32flash [-bvngfhc] [-[rw] filename] /dev/ttyS0 -b rate Baud rate (default 57600) -r filename Read flash to file -w filename Write flash to file -u Disable the flash write-protection -e n Only erase n pages before writing the flash -v Verify writes -n count Retry failed writes up to count times (default 10) -g address Start execution at specified address (0 = flash start) -f Force binary parser -h Show this help -c Resume the connection (don't send initial INIT) *Baud rate must be kept the same as the first init* This is useful if the reset fails I have an STM32 board connected to cuaU0/ttyU0: tingo@kg-core1$ ls -l /dev/cuaU* /dev/ttyU* crw-rw---- 1 uucp operator 0, 159 Aug 18 17:26 /dev/cuaU0 crw-rw---- 1 uucp operator 0, 160 Aug 18 17:26 /dev/cuaU0.init crw-rw---- 1 uucp operator 0, 161 Aug 18 17:26 /dev/cuaU0.lock crw-rw---- 1 root operator 0, 156 Aug 18 17:26 /dev/ttyU0 crw-rw---- 1 root operator 0, 157 Aug 18 17:26 /dev/ttyU0.init crw-rw---- 1 root operator 0, 158 Aug 18 17:26 /dev/ttyU0.lock and my user has access: tingo@kg-core1$ id uid=1001(tingo) gid=1001(users) groups=1001(users),0(wheel),5(operator) Still it doesn't work: tingo@kg-core1$ ./stm32flash /dev/cuaU0 stm32flash - http://stm32flash.googlecode.com/ /dev/cuaU0: No such file or directory tingo@kg-core1$ ./stm32flash /dev/ttyU0 stm32flash - http://stm32flash.googlecode.com/ /dev/ttyU0: No such file or directory t doesn't work as root either, so it doesn't look like a permissions problem. BTW, stm32flash with the same board and cable works nicely under Linux. Any hints on what could be wrong? References: 1) http://code.google.com/p/stm32flash/ -- Torfinn Ingolfsen