Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uart programming #1

Open
Kevin-010 opened this issue May 4, 2020 · 0 comments
Open

uart programming #1

Kevin-010 opened this issue May 4, 2020 · 0 comments

Comments

@Kevin-010
Copy link

Note: I use this code for production programming of devices as it is (for whatever reason) significantly faster and more robust than the tcl scriptable programmer. great job there.
for some reason the code as-is only supports usb programming despite the protocol for uart being identical - the baud is configured, but incorrectly for the sam-ba uart. note that baud is ignored for cdc serial and doesn't affect the data rate
tiny patch to enable programming over uart:

diff --git a/comm.c b/comm.c
index 0183c2a..af91a21 100644
--- a/comm.c
+++ b/comm.c
@@ -70,7 +70,7 @@ int samba_open(const char* device)
                return -1;
        }
 
-       if (!configure_tty(fd, B4000000)) {
+       if (!configure_tty(fd, B115200)) {
                close(fd);
                return -1;
        }

also note for any users here, the chip ids need updating for new device revisions. eg:

diff --git a/chipid.c b/chipid.c
index eb5e60b..041fb77 100644
--- a/chipid.c
+++ b/chipid.c
@@ -29,7 +29,8 @@ static const struct _chip _chips_samx7[] = {
        { "SAMS70Q21", 0xa1120e00, 0x00000002, 0x400e0c00, 0x00400000, 2048, 9 },
        { "SAMS70Q20", 0xa1120c00, 0x00000002, 0x400e0c00, 0x00400000, 1024, 9 },
        { "SAMS70Q19", 0xa11d0a00, 0x00000002, 0x400e0c00, 0x00400000,  512, 9 },
-       { "SAMS70N21", 0xa1120e00, 0x00000001, 0x400e0c00, 0x00400000, 2048, 9 },
+       { "SAMS70N21A", 0xa1120e00, 0x00000001, 0x400e0c00, 0x00400000, 2048, 9 },
+       { "SAMS70N21B", 0xa1120e01, 0x00000001, 0x400e0c00, 0x00400000, 2048, 9 },
        { "SAMS70N20", 0xa1120c00, 0x00000001, 0x400e0c00, 0x00400000, 1024, 9 },
        { "SAMS70N19", 0xa11d0a00, 0x00000001, 0x400e0c00, 0x00400000,  512, 9 },
        { "SAMS70J21", 0xa1120e00, 0x00000000, 0x400e0c00, 0x00400000, 2048, 9 },
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant